OCaml Weekly News

Previous Week Up Next Week


Here is the latest OCaml Weekly News, for the week of March 15 to 22, 2022.

Table of Contents

Friday 03/04 Intern presentations – open attendance!

Continuing this thread, Aya announced

Here is the link to the video recording of the presentations! Thanks again to everyone who attended :pray: :tada:

Multicore OCaml: February 2022

Anil Madhavapeddy announced

Welcome to the February 2022 Multicore OCaml monthly report! As with previous updates, these have been compiled by me, @ctk21, @kayceesrk and @shakthimaan.

Progress towards a stable OCaml 5.0.0 release have been moving forward at full steam, with most of the multicore OCaml work now happening directly within the main ocaml/ocaml repository. As a number of deprecations have happened in OCaml 5.0+trunk, it can be a little tricky in the immediate term to get a working development environment. You may find these resources helpful:

  • There is a multicore monorepo which is a 'fast clone and dune build' with a number of ecosystem libraries. (thanks @patricoferris)
  • There is an alpha-opam-repository which contains work-in-progress packages. If a package you maintain is in there, now would be a good time to start releasing it to the mainline opam-repository. Remember that while we can propose changes, only the community maintainers of the relevant projects can do the actual release, so your help with making OCaml 5.0-compatible releases of your projects would be very much appreciated. (thanks @kit-ty-kate)

For mainline development, the compiler development newsletter has an overview of what's been happening in the compiler. From a multicore perspective:

  • the ARM64 PR has been merged, so your shiny Mac M1s will now work
  • we continue to work on the post-Multicore merge tasks for an upcoming 5.0.0+trunk release. The documentation efforts on the OCaml memory model, runtime system, and STW synchronization have also started.
  • The eio project is actively being developed which now includes UDP support with Eio's networking interface. There has been robust discussion on several aspects of eio which is all influencing the next iteration of its design (thank you to everyone!). For those of you who do not wish to participate in public discussion, feel free to get in touch with me or @kayceesrk for a private discussion, particularly if you have a large OCaml codebase and opinions on concurrency. We'll summarise all these discussions as best we can over the coming months.
  • Sandmark-nightly and Sandmark have a custom variant support feature to build trunk, developer branches, or a specific commit to assess any performance regressions. The backend tooling with UI enhancements continue to drive the current-bench project forward.

As always, the Multicore OCaml updates are listed first, which are then followed by the ecosystem tooling updates. Finally, the sandmark, sandmark-nightly and current-bench project tasks are mentioned for your reference.

Editor’s note: please find the full update at the archive link above.

OCaml 4.14.0, second release candidate

octachron announced

The release of OCaml 4.14.0 is imminent. As a last test that everything is in order, we are publishing a second release candidate for OCaml 4.14.0.

We are directly jumping to the second release candidate due to a type system regression discovered during the release process of the first release candidate.

Compared to the last beta, this release candidate includes a regression fix when typing recursive constraints, two backend fixes (one for the frame-pointer mode and the other one for the RISC-V architecture), one configuration fix for musl/arm64, and the manual chapter for the TMC transformation.

If you find any bugs, please report them here:


The full release of OCaml 4.14.0 is currently planned for next week.

Installation instructions

The base compiler can be installed as an opam switch with the following commands

opam update
opam switch create 4.14.0~rc2 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git

If you want to tweak the configuration of the compiler, you can switch to the option variant with:

opam update
opam switch create <switch_name> --packages=ocaml-variants.4.14.0~rc2+options,<option_list>

where <option_list> is a comma separated list of ocaml-option-* packages. For instance, for a flambda and no-flat-float-array switch:

opam switch create 4.14.0~rc2+flambda+nffa

All available options can be listed with opam search ocaml-option.

The source code for the release candidate is also available at these addresses:

Changes since the last beta

Type system regression fix
  • #11101, #11109: A recursive type constraint fails on 4.14 (Jacques Garrigue, report and review by Florian Angeletti)
Backend fixes
  • #10688: Move frame descriptor table from `rodata` to `data` section on RISC-V. Improves support for building DLLs and PIEs. In particular, this applies to all binaries in distributions that build PIEs by default (eg Gentoo and Alpine). (Alex Fan, review by Gabriel Scherer)
  • #11031: Exception handlers restore the rbp register when using frame-pointers on amd64. (Fabrice Buoro, with help from Stephen Dolan, Tom Kelly and Mark Shinwell, review by Xavier Leroy)
Configuration fix
  • #11025, #11036: Do not pass -no-pie to the C compiler on musl/arm64 (omni, Kate Deplaix and Antonio Nuno Monteiro, review by Xavier Leroy)
  • updated entry #181, #9760, +#10740: opt-in tail-modulo-cons (TMC) transformation

    let[@tail_mod_cons] rec map f li = ...

    (Frédéric Bour, Gabriel Scherer, Basile Clément, review by Basile Clément and Pierre Chambart, tested by Konstantin Romanov)

For Diversity and the OCaml Community: Outreachy Summer 2022

Continuing this thread, Patrick Ferris said

Thanks for the updates @pitag! For this summer's round I'll be mentoring a project to Extend ocaml-geojson to support TopoJSON which will likely be a separate package. This is part of a larger effort I'm embarking on to provide better geospatial libraries and tools in OCaml!

I'd be very happy to have a co-mentor if the project (or just the idea of Outreachy) interests anyone. Don't hesitate to reach out to me on discuss publicly or privately if you are interested or have more questions :camel:

Understanding cancellation (in eio)

Deep in this thread, Simon Cruanes announced

I still have reservations about the capabilities aspect of Eio, but the structured concurrency part looks very nice. Just a few notes, for future reference to readers of this thread (if I haven't missed them being posted above already):

Another interesting post about structured concurrency and cancellation: https://250bpm.com/blog:71/

A structured concurrency library in python: trio, which might be relatively similar to Eio's switches in concept (esp since @talex linked this)?

Companion post to the trio blogpost: https://vorpus.org/blog/timeouts-and-cancellation-for-humans/ which is directly relevant to the current topic.

Atdpy: derive safe JSON interfaces for Python

Martin Jambon announced

On behalf of the ATD team, I'd like to announce atdpy, which is part of the release 2.3.x of the ATD tools. For now, the best installation method with via opam:

$ opam install atdpy

Atdpy is a new backend for ATD. It takes a collection of type definitions and derives Python classes with mypy type annotations that validate the JSON data.

A short introduction is included in the documentation.

Use cases:

  • Safe communication with another program that also uses an ATD interface. Other supported languages are OCaml (including Bucklescript), Java, and Scala.
  • Need for [mostly] type-safe Python methods via mypy.
  • Need for a good Python API to communicate with an OCaml executable or service.
  • Need for sum types (variants, algebraic data types, tagged unions). ATD sum types are ordinary types that include pure enums.

Atdpy was developed as part of our work on Semgrep at r2c. Many thanks to @mseri for his massive help during the opam release of the 7 ATD packages, and to the Ahrefs folks and @Khady in particular for supporting the project.


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.