[Caml-list] Attn: Development Editor, Latest OCaml Weekly News

Alan Schmitt
2021-02-02T13:56:17Z

[-- Attachment #1: Type: text/plain, Size: 18840 bytes --]

Hello

Here is the latest OCaml Weekly News, for the week of January 26 to
February 02, 2021.

Table of Contents
─────────────────

release 0.2.2 of ppx_deriving_encoding
OCaml 4.12.0, second beta release
OCaml Office Hours?
Timere 0.1.3 - Dealing with time and time zones have never been easier
Interesting OCaml Articles
json-data-encoding 0.9
ocamlearlybird 1.0.0 beta1
Cmdliner cheatsheet
containers 3.2
OCaml Café: Thu, Feb 11 @ 7pm (U.S. Central)
Dependency graph of some OCaml source files
Other OCaml News
Old CWN

release 0.2.2 of ppx_deriving_encoding
══════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-release-0-2-2-of-ppx-deriving-encoding/7169/1>

levillain.maxime announced
──────────────────────────

Following the release of [json-data-encoding.0.9], I am happy to
announce the release of ppx_deriving_encoding.0.2.2.

The code source and some documentation is available on [gitlab], and
the package can be installed with opam (`opam install
ppx_deriving_encoding').

This ppx allows to derive encoding of json-data-encoding library from
most of ocaml types.

Have fun!

[json-data-encoding.0.9]
<https://discuss.ocaml.org/t/ann-json-data-encoding-0-9/7157>

[gitlab] <https://gitlab.com/o-labs/ppx_deriving_encoding>

OCaml 4.12.0, second beta release
═════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ocaml-4-12-0-second-beta-release/7171/1>

octachron announced
───────────────────

The release of OCaml 4.12.0 is on the horizon. We have created a new
beta version to help you adapt your software to the new features ahead
of the release.

Compared to the first beta release, this new release contains one fix
for the Thread library (for a race condition on Windows), and
experimentally re-enables building the compiler on illumos and Oracle
Solaris.

We are expecting this beta to be the last one before the release.

If you find any bugs, please report them here:
<https://github.com/ocaml/ocaml/issues>

Happy hacking,

– Florian Angeletti for the OCaml team.

Installation instructions
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

The base compiler can be installed as an opam switch with the
following commands
┌────
│ opam update
│ opam switch create 4.12.0~beta2 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
└────
If you want to tweak the configuration of the compiler, you can pick
configuration options with
┌────
│ opam update
│ opam switch create <switch_name> --packages=ocaml-variants.4.12.0~beta2+options,<option_list>
│ --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
└────
where <option_list> is a comma separated list of ocaml-option-*
packages. For instance, for a flambda and afl enabled switch:
┌────
│ opam switch create 4.12.0~beta2+flambda+afl
│ --packages=ocaml-variants.4.12.0~beta2+options,ocaml-option-flambda,ocaml-option-afl
│ --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
└────
All available options can be listed with "opam search ocaml-option".

The source code is available at these addresses:

• <https://github.com/ocaml/ocaml/archive/4.12.0-beta2.tar.gz>
• <https://caml.inria.fr/pub/distrib/ocaml-4.12/ocaml-4.12.0~beta2.tar.gz>

If you want to test this version, you may want to install the alpha
opam repository

<https://github.com/kit-ty-kate/opam-alpha-repository>

with
┌────
│ opam repo add alpha git://github.com/kit-ty-kate/opam-alpha-repository.git
└────
This alpha repository contains various packages patched with fixes in
the process of being upstreamed. Once the repository installed, these
patched packages will take precedence over the non-patched version.

Changes from the first beta
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

Thread library
┄┄┄┄┄┄┄┄┄┄┄┄┄┄

• *additional fixes* [9757], [9846], +[10161]: check proper ownership
when operating over mutexes. Now, unlocking a mutex held by another
thread or not locked at all reliably raises a Sys_error exception.
Before, it was undefined behavior, but the documentation did not
say so. Likewise, locking a mutex already locked by the current
thread reliably raises a Sys_error exception. Before, it could
deadlock or succeed (and do recursive locking), depending on the
OS. (Xavier Leroy, report by Guillaume Munch-Maccagnoni, review by
Guillaume Munch-Maccagnoni, David Allsopp, and Stephen Dolan)

[9757] <https://github.com/ocaml/ocaml/issues/9757>

[9846] <https://github.com/ocaml/ocaml/issues/9846>

[10161] <https://github.com/ocaml/ocaml/issues/10161>

Build system
┄┄┄┄┄┄┄┄┄┄┄┄

• [10063]: (Re-)enable building on illumos (SmartOS, OmniOS, …) and
Oracle Solaris; x86_64/GCC and 64-bit SPARC/Sun PRO C
compilers. (partially revert [2024]). (Tõivo Leedjärv and Konstantin
Romanov, review by Gabriel Scherer, Sébastien Hinderer and Xavier
Leroy)

[10063] <https://github.com/ocaml/ocaml/issues/10063>

[2024] <https://github.com/ocaml/ocaml/issues/2024>

Documentation
┄┄┄┄┄┄┄┄┄┄┄┄┄

• [9755]: Manual: post-processing the html generated by ocamldoc and
hevea. Improvements on design and navigation, including a mobile
version, and a quick-search functionality for the API. (San Vũ Ngọc,
review by David Allsopp and Florian Angeletti)

• [10142], [10154]: improved rendering and latex code for toplevel
code examples. (Florian Angeletti, report by John Whitington, review
by Gabriel Scherer)

[9755] <https://github.com/ocaml/ocaml/issues/9755>

[10142] <https://github.com/ocaml/ocaml/issues/10142>

[10154] <https://github.com/ocaml/ocaml/issues/10154>

OCaml Office Hours?
═══════════════════

Archive: <https://discuss.ocaml.org/t/ocaml-office-hours/7132/9>

Deep in this thread, Orbifx said
────────────────────────────────

And there is XMPP: <xmpp:ocaml@conference.orbitalfox.eu?join>

Timere 0.1.3 - Dealing with time and time zones have never been easier
══════════════════════════════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-timere-0-1-3-dealing-with-time-and-time-zones-have-never-been-easier/7173/1>

Darren announced
────────────────

I am happy to announce first release of [Timere], a time handling and
reasoning library, which @Drup and I have been working on recently.

[Timere] <https://github.com/daypack-dev/timere>

Examples
╌╌╌╌╌╌╌╌

Christmases which fall on Wednesday from now
┌────
│ let () =
│ let open Timere in
│ match
│ resolve (
│ after (Date_time.now ())
│ & months [`Dec]
│ & days [25]
│ & weekdays [`Wed]
│ )
│ with
│ | Error msg -> failwith msg
│ | Ok s ->
│ Fmt.pr "%a@." (pp_intervals ~sep:(Fmt.any "@.") ()) s
└────
gives
┌────
│ [2024 Dec 25 00:00:00 +00:00:00, 2024 Dec 26 00:00:00 +00:00:00)
│ [2030 Dec 25 00:00:00 +00:00:00, 2030 Dec 26 00:00:00 +00:00:00)
│ [2041 Dec 25 00:00:00 +00:00:00, 2041 Dec 26 00:00:00 +00:00:00)
│ [2047 Dec 25 00:00:00 +00:00:00, 2047 Dec 26 00:00:00 +00:00:00)
│ [2052 Dec 25 00:00:00 +00:00:00, 2052 Dec 26 00:00:00 +00:00:00)
│ [2058 Dec 25 00:00:00 +00:00:00, 2058 Dec 26 00:00:00 +00:00:00)
│ ...
└────

See [here] for more examples

[here] <https://github.com/daypack-dev/timere/tree/main/examples>

Features
╌╌╌╌╌╌╌╌

• Timestamp and date time handling with platform independent time zone
support
• Subset of the IANA time zone database is built into this library
• Reasoning over time intervals via timere objects/expressions,
examples:
• Pattern matching time and intervals. These work across DST
boundaries.
• Intersection and union
• Chunking at year or month boundary, or in fixed sizes
• Evaluate (sub)expressions with a different time zone
(e.g. intersection of 9am to 5pm of Sydney and 9am to 5pm of New
York)

Links
╌╌╌╌╌

• Repo: <https://github.com/daypack-dev/timere>
• API doc:
<https://daypack-dev.github.io/timere/timere/Timere/index.html>

Interesting OCaml Articles
══════════════════════════

Archive:
<https://discuss.ocaml.org/t/interesting-ocaml-articles/1867/92>

Yawar Amin announced
────────────────────

Not primarily a programming article but I thought this is an
interesting exception because it may be the first time OCaml has been
mentioned in the Financial Times:
<https://www.ft.com/content/81811f27-4a8f-4941-99b3-2762cae76542>

json-data-encoding 0.9
══════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-json-data-encoding-0-9/7157/2>

Raphaël Proust announced
────────────────────────

On behalf of Nomadic Labs, it is my pleasure to release
json-data-encoding.0.9.1. The code of this packaging-fix release is
identical to the recent json-data-encoding.0.9 but the license
information has been corrected.

The previous release had _LGPL with linking exception_ headers in the
source files, LICENSE file in the repository, and license field in the
opam file. However, the code was actually under MIT as per agreement
of the copyright holders. Release 0.9.1 has the correct license
headers, LICENSE file and license field in the opam files.

The code of 0.9/0.9.1 is in dual license. Future releases will be
under MIT license only.

ocamlearlybird 1.0.0 beta1
══════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-ocamlearlybird-1-0-0-beta1/7180/1>

文宇祥 announced
────────────────

I'm pleased to annonce that [ocamlearlybird] 1.0.0~beta1 just
released. Will soon be available on opam.

This is a big step that we toward 1.0.0. We solved lots of issues and
tested with realy ocaml projects such as utop, ocamlformat, and so
on. And certainly, it can debug ocamlearlybird itself.

Try yourself!

[ocamlearlybird] <https://github.com/hackwaly/ocamlearlybird>

NOTES.
╌╌╌╌╌╌

• New version only support OCaml 4.11. If you need other versions
support, please let me know.
• Dune-release do not support `1.0.0~beta1' version string. So we
released 1.0.0 as 1.0.0~beta1 on opam.

KNOWN ISSUES:
╌╌╌╌╌╌╌╌╌╌╌╌╌

• Continue run command may hit on last removed breakpoint once when
debug utop.

文宇祥
──────

Since the post has edited over 3 times. I can't edit it anyway. I
uploaded demo video here:

[Debug utop]

[Debug utop]
<https://media.githubusercontent.com/media/hackwaly/ocamlearlybird/master/_assets/utop.webp>

Cmdliner cheatsheet
═══════════════════

Archive: <https://discuss.ocaml.org/t/cmdliner-cheatsheet/7185/1>

Martin Jambon announced
───────────────────────

As a follow-up to [an earlier conversation], I made a [cheatsheet and
a template] for using cmdliner by @dbuenzli. It was done quickly and I
don't know everything about cmdliner, so please let me know if you see
mistakes.

[an earlier conversation]
<https://discuss.ocaml.org/t/what-are-some-libraries-you-almost-always-use/7165/17?u=mjambon>

[cheatsheet and a template]
<https://github.com/mjambon/cmdliner-cheatsheet>

Christian Lindig then said
──────────────────────────

Good to see this. I believe a common use case is to add are sub
commands as popularised by `git'. It looks like this in my code:

┌────
│ module C = Cmdliner
│
│ let report =
│ let doc = "generate HTML or JSON report for an outing" in
│ let man = .. in
│ C.Term.
│ (ret (const make $ common_options $ json $ path), info "report" ~doc ~man)
│
│ let default =
│ let help = `Help (`Pager, None) in
│ let doc = "GPS analysis for rowers" in
│ C.Term.(ret @@ const help, info "eightplus" ~doc ~man)
│
│ let cmds = [ export; report; topspeed; debug; summary; help ]
│ let main () = C.Term.(eval_choice default cmds |> exit)
│ let () = if !Sys.interactive then () else main ()
└────

Martin Jambon later said
────────────────────────

I just added a demo/template for subcommand handling. There are now
[two demo programs]. One is focused on the different kinds of
arguments and the other one on subcommands.

[two demo programs]
<https://github.com/mjambon/cmdliner-cheatsheet/tree/main/src>

Shon also replied
─────────────────

In this same vein, I've been compiling "executable notes" whenever I
find myself needing a certain Cmdlner recipe. I took took these recent
discussion as an occasion to document the module a bit:
<https://github.com/shonfeder/kwdcmd>

The aim is to provide "self-documenting" constructors that encode the
composition of common CLI terms into module namespaces, labeled args,
and type aliases. The hope being that I can have the type signature of
a combinator give me all the hints I need to avoid having to look up
the documentation every time :laughing:

It's just a very rough (and quite imperfect) collection of idioms I've
found useful, but it could be worth a look! When i get a chance, I
hope to look through your cheat sheet to make sure I have a
representative constructor for each idiom you've documented.

containers 3.2
══════════════

Archive: <https://discuss.ocaml.org/t/ann-containers-3-2/7196/1>

Simon Cruanes announced
───────────────────────

I'm happy to announce that containers 3.2 has just been [released]. It
should arrive on opam soon. It notably contains an `Either'
compatibility wrapper, more formatting functions, list functions, and
a bunch of fixes. Many thanks to @darrenldl for contributing some
initial fuzzing support.

[released]
<https://github.com/c-cube/ocaml-containers/releases/tag/v3.2>

OCaml Café: Thu, Feb 11 @ 7pm (U.S. Central)
════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ocaml-cafe-thu-feb-11-7pm-u-s-central/7197/1>

Claude Jager-Rubinson announced
───────────────────────────────

Join us with your questions about the OCaml language, or just to hang
out with the OCaml community. Especially geared toward new and
intermediate users, experienced OCaml developers will be available to
answer your questions about the language and ecosystem.

Whether you’re still trying to make sense of currying or can spot
non-tail-recursive code from across the room, we hope that you’ll join
us on Thursday, February 11 at 7pm (U.S. Central time). Meeting info
and additional details can be found at [https://hfpug.org].

[https://hfpug.org] <https://hfpug.org>

Dependency graph of some OCaml source files
═══════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/dependency-graph-of-some-ocaml-source-files/7198/6>

Deep in this thread, Jun FURUSE said
────────────────────────────────────

You may be interested in [cmgraph] which scrapes the compiled modules
(`*.cmi/*.cmo/*.cmx') instead of the source code. It needs no
compilation switch options since it does not scrape source code.

[cmgraph] <https://gitlab.com/camlspotter/cmgraph>

Other OCaml News
════════════════

From the ocamlcore planet blog
──────────────────────────────

Here are links from many OCaml blogs aggregated at [OCaml Planet].

• [Recent and upcoming changes to Merlin]
• [The road ahead for MirageOS in 2021]
• [Release of Alt-Ergo 2.4.0]

[OCaml Planet] <http://ocaml.org/community/planet/>

[Recent and upcoming changes to Merlin]
<https://tarides.com/blog/2021-01-26-recent-and-upcoming-changes-to-merlin>

[The road ahead for MirageOS in 2021] <https://hannes.nqsb.io/Posts/NGI>

[Release of Alt-Ergo 2.4.0]
<https://www.ocamlpro.com/2021/01/22/release-of-alt-ergo-2-4-0/>

Old CWN
═══════

If you happen to miss a CWN, you can [send me a message] and I'll mail
it to you, or go take a look at [the archive] or the [RSS feed of the
archives].

If you also wish to receive it every week by mail, you may subscribe
[online].

[Alan Schmitt]

[send me a message] <mailto:alan.schmitt@polytechnique.org>

[the archive] <https://alan.petitepomme.net/cwn/>

[RSS feed of the archives] <https://alan.petitepomme.net/cwn/cwn.rss>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>

[-- Attachment #2: Type: text/html, Size: 37092 bytes --]