OCaml Weekly News

Previous Week Up Next Week


Here is the latest OCaml Weekly News, for the week of April 11 to 18, 2023.

Table of Contents

You started to learn OCaml less than 12 months ago? Please help us with our user survey on the OCaml.org Learning Area

Sabine Schmaltz asked

We’re asking specifically for you, if your experience of learning OCaml is still ongoing or so recent that you still remember

  1. what you struggled with (or still feel like you’re struggling),
  2. how the current materials failed you,
  3. what other materials helped you understand.

if you have previous experience in other languages, we also find it highly interesting to learn about resources that you found particularly effective/engaging/educational and why you think they are particularly great.

Our goal is to improve the “Learn” area of OCaml.org - and this is a pretty broad topic in the sense that we want to provide a framework on OCaml.org where content is organised properly in such a way that information is easy to find and effective to use for various people with different backgrounds and learning styles.

The survey is here: https://forms.gle/L1oQgEs3N9D6qx5v9

If you indicate you’re available for interview, our UX designer Claire may contact you to schedule a video call with you.

There will be a summary of the points brought up no later than May 5 in this thread.

First alpha release of OCaml 5.1.0

octachron announced

Four months after the release of OCaml 5.0.0, the set of new features for the future version 5.1.0 of OCaml has been frozen. I am thus happy to announce the first alpha release for OCaml 5.1.0 .

This alpha version is here to help fellow hackers join us early in our bug hunting and opam ecosystem fixing fun (see below for the installation instructions). You can see the progress on this front at


If you find any bugs, please report them here:


Note that this early alpha version is missing two important fixes for the garbage collector and Windows support. Those fixes will be available before the beta. The full release is expected to happen in July.

If you are interested by the ongoing list of new features and bug fixes, the updated change log for OCaml 5.1.0 is available at:


Installation Instructions

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

opam update
opam switch create 5.1.0~alpha1

For previous version of opam, the switch creation command line is slightly more verbose:

opam update
opam switch create 5.1.0~alpha1

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> ocaml-variants.5.1.0~alpha1+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 5.1.0~alpha1+flambda+nffa ocaml-variants.5.1.0~alpha1+options
ocaml-option-flambda ocaml-option-no-flat-float-array

The command line above is slightly more complicated for opam version anterior to 2.1:

opam update
opam switch create <switch_name>

In both cases, all available options can be listed with “opam search ocaml-option”.

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

Interesting OCaml Articles

james woodyatt announced

Our @yallop is one of the authors of this paper about parsing.

flap: A Deterministic Parser with Fused Lexing

Lexers and parsers are typically defined separately and connected by a token stream. This separate definition is important for modularity and reduces the potential for parsing ambiguity. However, materializing tokens as data structures and case-switching on tokens comes with a cost. We show how to fuse separately-defined lexers and parsers, drastically improving performance without compromising modularity or increasing ambiguity. We propose a deterministic variant of Greibach Normal Form that ensures deterministic parsing with a single token of lookahead and makes fusion strikingly simple, and prove that normalizing context free expressions into the deterministic normal form is semantics-preserving. Our staged parser combinator library, flap, provides a standard interface, but generates specialized token-free code that runs two to six times faster than ocamlyacc on a range of benchmarks.

Porting a OCaml3-based game to the latest version of OCaml

nova4216 asked

Guys, there is not a trivial task.

There is a game engine on OCaml + a game written on this game engine. This was all written about 10 years ago, on version Ocaml 3. Camplp4 was used as a preprocessor. And the compiler was patched to correctly generate ARM code for iOS.

The task is to port the engine and the game to the latest version of Ocaml which supports arm64 on all platforms by default.

We can make the engine Open Source - maybe it will help the Ocaml community to release more games in their favorite language for mobile platforms.

If anyone is interested in the task - feel free to contact me, and we will be glad to discuss the details! Of course, there will be a reward for successful completion of the task.


nova4216 later added

The game itself is called The Big Farm Theory. The engine in this thread is Lightning:


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.