OCaml Weekly News

Previous Week Up Next Week


Here is the latest OCaml Weekly News, for the week of October 31 to November 07, 2023.

Table of Contents

A second article about Miou

Dinosaure announced

I finally made my second article about #Miou (#OCaml 5 & #multicore) and its notion of rules. It’s available here: https://blog.osau.re/articles/miou_rules.html (enjoy the reading).

atddiff: report incompatibilities after modifying a typed interface

Martin Jambon announced


ATD stands for “Adjustable Type Definitions”. The ATD project consists of a language for specifying types and their JSON representation and code generators that make it safe and easy to read and write JSON data. It currently offers interoperability for 6 programming languages (D, Java, OCaml, Scala, TypeScript, Python/Mypy).

Tracking incompatibilities with atddiff

Atddiff takes two versions of an .atd file, which is a collection of type definitions, compares them and reports incompatibilities. Here’s a simple example:

(* example.v1.atd  *)
type t = {
  x: string;
(* example.v2.atd *)
type t = {
  ?x: string option;

Atddiff finds one problem:

$ atddiff example.v1.atd example.v2.atd
[221ed3ce] Forward incompatibility:
File "example.v1.atd", line 2, characters 2-11
File "example.v2.atd", line 2, characters 2-19:
Formerly required field 'x' is now optional.
The following types are affected:

Incompatibilities can be backward (= can’t read older data), forward (= can’t read newer data), or both. Depending on the use case for a type, the user may care about just one direction. The documentation expands a bit on this and provides a command to use atddiff with git.

The recommended version of atddiff is the latest, >= 2.15.0. It is installed as part of the atd opam package:

opam update
opam install atd.2.15.0

OCaml implementation of webbench

bigconvience announced


webbench_ml is the OCaml implementation of webbench

Web Bench

Web Bench is very simple tool for benchmarking WWW or proxy servers. Uses fork() for simulating multiple clients and can use HTTP/0.9-HTTP/1.1 requests. This benchmark is not very realistic, but it can test if your HTTPD can realy handle that many clients at once (try to run some CGIs) without taking your machine down. Displays pages/min and bytes/sec. Can be used in more aggressive mode with -f switch.


$ git clone https://github.com/bigconvience/webbench_ml.git
$ cd webbench_ml
$ eval `opam env`
$ dune build
$ dune exec -- webbench -t 10 -c 20

Using Docusaurus to document an OCaml project

Mathieu Barbin announced


I wanted to share some positive feedback on using Docusaurus to document an OCaml Project: Bopkit.

Among the reasons I choose to experiment with it was its compatibility with ocaml-mdx and the dune-runtest & dune-promote workflow. That is, a lot of the dynamic contents that shows in the doc stays in sync when the code is updated during development, including file parts, expect tests traces and mermaid diagrams.

I also liked the fact that the contents is mostly based on *.md files that are present in the tree, and those that can be browsed directly from GitHub as well (such as all the README.md found at the leaf of the project’s directory structure, which are rendered similarly by GitHub).

This integrates well with GitHub and GitHub Actions in that the doc can be hosted directly in the GitHub pages of the project.

I’ve also experimented with their support for a global search box via algoalia which was overall straight forward to setup.

As a side note, I just went through their v3 migration guide, and I liked the experience.

Putting it out there in case you’re interested in trying it out, or simply want to browse an example of a Docusaurus setup involving an OCaml project using ocaml-mdx and dune.


Release of ocaml-sf/learn-ocaml:0.16.0

Erik Martin-Dorel announced

Dear all,

We are pleased to announce the latest stable release of Learn-OCaml, version 0.16.0.

Many thanks to all users who contributed bugs reports, fixes, and enhancements!

A comprehensive list of the fixes and enhancements offered by this release is available in the Release Notes which also gathers static binaries for Linux and macOS, the corresponding opam-repository pull request is pending, and the Docker images of learn-ocaml and learn-ocaml-client are immediately available on Docker Hub.

If you happen to maintain a learn-ocaml server, we strongly recommend that you update your version to 0.16.0 to benefit from important fixes, as well as newest features.


  1. From a student point-of-view, a feature developed by M. Hernouf, D. Pinto, and L. Gesbert from OCamlPro significantly improves the UI/UX for the exercises list, adding three sub-tabs By category, By skill (see the screenshot below), and By difficulty, with collapsible blocks:


  2. From a teacher point-of-view, the handling of Open/Closed status for assigned exercises has been significantly improved (cf. issues #534 and #558). When exercises are assigned, learn-ocaml’s teacher tab now shows the global-status of the exercises, especially for unassigned students (see the screenshot below). The underlying soundness invariant has been made explicit, and is now verified using a dedicated ppx_expect test suite.


If need be, feel free to open issues in the Learn-OCaml bug tracker or the learn-ocaml.el bug tracker, or post in this thread to share comments.

Happy OCaml learning and teaching, and stay tuned for the next release!

Erik Martin-Dorel for the Learn-OCaml team 🐫

Erik Martin-Dorel later added

For those who don’t know the learn-ocaml platform yet:

  • the learn-ocaml artifact (distributed under the MIT license) is a full-stack web server written in OCaml, fully customizable to serve Markdown-based lectures and interactive exercises endowed with auto-grading tests, written in OCaml as well;
  • an emacs frontend for learn-ocaml is also available on MELPA;
  • the learn-ocaml-corpus is a large collection of exercises that originated in the OCaml MOOC and has been further extended by several authors since then;
  • a static instance of learn-ocaml, combining the latest release of learn-ocaml and learn-ocaml-corpus’ exercises, is available at: https://ocaml-sf.org/learn-ocaml-public/

Discord.ml: Eio-based Discord library with voice support

anqou announced

Hi. I’m writing a Discord library, Discord.ml, in OCaml for my personal project. As of now, it supports voice functionality as well as text one, and you can write, for example, a music bot with this library.


I used Eio to write this library and wrote a simple Erlang-like actor model implementation (actaa). Also, I used Cohttp-eio (beta1) with ocaml-websocket to communicate with the Discord’s server (gateway).

I hope someone may be interested in this library. Any feedback would be appreciated!

Release of Fmlib 0.5.7

Helmut announced

Hi all,

I am happy to annouce the release 0.5.7 of Fmlib.

This release makes some minor improvements for combinator parsing with separate lexer and parser. The position information contains now character and byte offsets and offers position range information on syntax errors.

For more information on combinator parsing with separate lexer and parser please read https://hbr.github.io/fmlib/odoc/fmlib_parse/parse_lex.html.

Survey on the new “Getting Started” Documentation on OCaml.org

Sabine Schmaltz announced

Hello everyone,

we’ve prepared a survey to capture some anonymous feedback on the new documentation in the “Getting Started” section on OCaml.org.

I’d be stoked if you could help us by reviewing the new pages and completing the survey, no matter if you’re a newcomer to OCaml or not.

We’re conducting this survey to understand if and what we need to change going forward, so that, in the end, we have documentation that works for newcomers with varying backgrounds on OCaml.org. We’re doing this in a non-public survey, so that everyone can speak their mind freely without being judged. A summary of points brought up will be posted at latest by Nov 30 as a response to this post.

If you’re interested in contributing to the documentation, or having a call with us, there’s a question at the very end of the survey where you can leave your Email so we can reach out to you.

Thanks for participating! Let’s make the OCaml documentation awesome! :fire:


Other OCaml News


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 to the caml-list.