OCaml Weekly News

Previous Week Up Next Week


Here is the latest OCaml Weekly News, for the week of February 27 to March 05, 2024.

Table of Contents

mirage-crypto 0.11.3 (with more speed for elliptic curves) – and the future roadmap of mirage-crypto

Hannes Mehnert announced

we’re happy to announce mirage-crypto 0.11.3 (which just got merged to opam-repository), which includes huge performance improvements for elliptic curves. The API didn’t change at all :)

The background story is that we finally merged the “use bytes instead of Cstruct.t” PR which was opened ~​2.5 years ago by @dinosaure. We reviewed that, and did some benchmarks. And even went a bit further and are now using string (instead of bytes). See https://blog.robur.coop/articles/speeding-ec-string.html for further details.

Another PR worth mentioning is use windowed algorithm for base scalar multiplication from Virgile Robles – now some precomputed tables are shipped (same approach was done for 25519 already).

See this PR (and the release notes) for some detailed performance numbers on different CPUs – the P256 sign operation is around 10x faster than older releases. This is still 5 times slower than OpenSSL - but then we use fiat-crypto instead of handcrafted assembly code. We’re keen to improve the performance even further – ideas, observations, experiments and PRs are very welcome. We investigated benchmarking of e.g. digest algorithms across the OCaml ecosystem and OpenSSL as baseline and welcome improvements and further work on that (especially AES-GCM and Poly1305-ChaCha20 are painfully slow compared to OpenSSL).

Other improvements and fixes include support for Loongarch, NetBSD, use rdtime instead of rdcycle on RISC-V when in user mode, initial support for CL.EXE. Thanks to everyone involved in this released: @jbeckford @reynir @dinosaure @palainp @edwin

The full changelog may be worth to read.

Future roadmap (breaking changes)

Also, please note if you’re using mirage-crypto that we’ll revise the API and no longer use Cstruct.t / bigarrays, but instead bytes/string. 0.11.3 will be the last release using Cstruct.t. The hash functionality (Mirage_crypto.Hash) will also be removed (since digestif implements them nicely). Please voice your concerns / ideas at https://github.com/mirage/mirage-crypto/issues/205

Ocsigen: summary of recent releases

Vincent Balat announced

Eliom 10.3.1 released:

OCaml Platform Newsletter: January 2024

Thibaut Mattio announced

Welcome to the ninth edition of the OCaml Platform newsletter!

In this January 2024 edition, we are excited to bring you the latest on the OCaml Platform, continuing our tradition of highlighting recent developments as seen in previous editions. To understand the direction we’re headed, especially regarding development workflows and user experience improvements, check out our roadmap.


  • A preview version of the long-awaited Merlin project-wide references is available. Read more on the announcement.
  • A first beta of opam 2.2 is available! Try it, and let the opam team know if you encounter any issues using opam on Windows.
  • The odoc team started an effort to unify the OCaml.org package documentation with the local workflow provided by Dune. This is very exciting, as the result should be a much improved local documentation with Dune and faster releases of odoc features on OCaml.org. They are at the very beginning of the project, but stay tuned for exciting news in the coming months!


[Dune] Exploring Package Management in Dune (W4)

Contributed by: @rgrinberg (Tarides), @Leonidas-from-XIV (Tarides), @gridbugs (Tarides), @kit-ty-kate (Tarides), @Alizter

Why: Unify OCaml tooling under a single command line for all development workflows. This addresses one of the most important pain points reported by the community.

What: Prototyping the integration of package management into Dune using opam as a library. We’re introducing a dune pkg lock command to generate a lock file and enhancing dune build to handle dependencies in the lock file. More details in the Dune RFC.


[opam] Native Support for Windows in opam 2.2 (W5)

Contributed by: @rjbou (OCamlPro), @kit-ty-kate (Tarides), @dra27 (Tarides), @AltGr (OCamlPro)

Why: Enhance OCaml’s viability on Windows by integrating native opam and opam-repository support, fostering a larger community and more Windows-friendly packages.

What: Releasing opam 2.2 with native Windows support, making the official opam-repository usable on Windows platforms.


[​odoc​] Unify OCaml.org and Local Package Documentation


Contributed by: @jonludlam (Tarides), @julow (Tarides), @panglesd (Tarides)

Why: Improving local documentation generation workflow will help package authors write better documentation for their packages, and consolidating the different odoc documentation generators will help make continuous improvements to odoc available to a larger audience.

What: We will write conventions that drivers must follow to ensure that their output will be functional. Once established, we will update the dune rules to follow these rules, access new odoc features (e.g., source rendering) and provide similar functionalities to docs.ocaml.org (a navigational sidebar for instance). This will effectively make Dune usable to generate OCaml.org package documentation.


  • We started by comparing the various drivers, their needs and constraints, and to flesh out what the conventions could look like. We will publish an RFC before starting the implementation work to ensure that we indeed understood the needs of everyone.

[​odoc​] Add Search Capabilities to odoc (W25)

Contributed by: @panglesd (Tarides), @EmileTrotignon (Tarides), @julow (Tarides), @jonludlam (Tarides)

Why: Improve usability and navigability in OCaml packages documentation, both locally and on OCaml.org, by offering advanced search options like type-based queries.

What: Implementing a search engine interface in odoc, complete with a UI and a search index. Additionally, we’re developing a default client-side search engine based on Sherlodoc.


  • We kept working on Sherlodoc in Januray, and a new version was released a few weeks ago, which can now be embedded on odoc-built doc sites.
  • We also finished updating the Dune rules which drive odoc, to enable the new search feature on locally built docs. These changes were released as part of Dune 3.14.0. – ocaml/dune#9772

[​odoc​] Syntax for Images and Assets in odoc (W25)

Contributed by: @panglesd (Tarides), @jonludlam (Tarides), @dbuenzli, @gpetiot (Tarides)

Why: Empower package authors to create rich, engaging documentation by enabling the integration of multimedia elements directly into OCaml package documentation.

What: We’re introducing new syntax and support for embedding media (images, audio, videos) and handling assets within the odoc environment.


  • The PR is still under active review and we’re addressing the last minor concerns. – ocaml/odoc#1002

[​odoc​] Improving odoc Performance (W25)

Contributed by: @jonludlam (Tarides), @julow (Tarides), @gpetiot (Tarides)

Why: Address performance issues in odoc, particularly for large-scale documentation, to enhance efficiency and user experience and unlock local documentation generation in large code bases.

What: Profiling odoc to identify the main performance bottlenecks and optimising odoc with the findings.


  • We investigated a couple of issues brought forth by the module type of fix that was mentioned last month. This eventually resulted in a series of PRs: ocaml/odoc#1078, ocaml/odoc#1079 and ocaml/odoc#1081
  • We also noticed that odoc’s handling of the load path was quadratic, so we changed that in ocaml/odoc#1075.

[Merlin] Support for Project-Wide References in Merlin (W19)

Contributed by: @voodoos (Tarides), @trefis (Tarides), @Ekdohibs (OCamlPro), @gasche (INRIA), @Octachron (INRIA)

Why: Enhance code navigation and refactoring for developers by providing project-wide reference editor features, aligning OCaml with the editor experience found in other languages.

What: Introducing merlin single occurrences and LSP textDocument/references support, extending compiler’s Shapes for global occurrences and integrating these features in Dune, Merlin, and OCaml LSP.


[Merlin] Improving Merlin’s Performance (W19)

Contributed by: @pitag (Tarides), @Engil (Tarides)

Why: Some Merlin queries have been shown to scale poorly in large codebases, making the editor experience subpar. Users report that they sometimes must wait a few seconds to get the answer. This is obviously a major issue that hurts developer experience, so we’re working on improving Merlin performance when it falls short.

What: Developing benchmarking tools and optimising Merlin’s performance through targeted improvements based on profiling and analysis of benchmark results.


  • We merged the Fuzzy testing CI. As a reminder, this CI tests Merlin PRs for behaviour regressions. This will help us make sure that we don’t inadvertently break Merlin queries by testing them on a broad range of use cases - ocaml/merlin#1716
  • In merlin-lib, we started writing a prototype to process the buffer in parallel with the query computation. Parallelism refers to OCaml 5 parallelism (domains).

Discussions on the future of the opam repository

Kate announced

The notes for last week’s meeting are available here

For everyone who wants to come to the next meeting, please fill the framadate as soon as you know when you are available, so that we can plan when the meeting is going to be.

ocaml-protoc-plugin 5.0.0

Anders Fugmann announced

It’s my pleasure to announce release 5.0.0 of ocaml-protoc-plugin.

ocaml-protoc-plugin is a plugin for the google protobuf compiler, protoc, to generate type mappings and functions for serialization and de-serialization of google protocol buffers. The plugin aims to be fully compliant with the protobuf specification and recommendations and to generate an intuitive mapping between google protobuf message definitions and Ocaml types. Ocaml-protoc-plugin is written in pure ocaml.

Version 5.0.0 includes option to merge messages to be fully compliant with the protobuf specification and fixes bugs related to name mapping to avoid name collisions and fix code generation error in some corner cases.

Serialization and deserialization has also been hugely optimized for speed and is now on par with other ocaml protobuf implementations (benched against ocaml-protoc)

ocaml-protobuf-plugin 5.0.0 is available though opam and from the project page on github.

Full changelog is available here

ppx_minidebug 1.3.0: toward a logging framework

Lukasz Stafiniak announced

Hi! I’m happy to invite you to take a look at ppx_minidebug 1.3.0. It’s now available in the opam repository. Some new features since version 1.0:

  • Extension point variants that support debug runtime passing, they simplify having e.g. dedicated log files for threads or domains.
  • Unregistered extension points %log, %log_result, %log_printbox to explicitly log values.
  • Log levels at runtime to restrict how much is logged, and at compile time to restrict how much logging code is generated.
    • Log levels can be both set globally and adjusted for local scopes.
    • Compile time log levels can be read off an environment variable.
  • Extension point prefix %diagn_ (joining prefixes %debug_ and %track_) that restricts the log level to explicit logs.
  • Does not crash for logs that escaped all log entries – prints the entry id of the entry the orphaned log lexically belongs to.
    • Optionally prints log entry ids for all entries.
  • Optionally snapshots unclosed log trees:
    • outputs the current log tree if sufficient time passed since the previous tree was printed or the previous snapshot, erases the previous snapshot when snapshotting or printing the same log tree.
  • A few more changes that improve usability.

P.S. If you face problems with missing line breaks in the HTML output, re-install printbox from source or version > 0.10.

iostream 0.2

Simon Cruanes announced

Iostream 0.2 was recently released on opam. Here’s the release itself.

Iostream is a library providing a small set of abstractions for I/O streams (!) over bytes. With release 0.2, there are now 4 main types, all of them based on objects:

I found out that having all these explicit types is better than picking only some of them. A In_buf.t can act as a proper byte stream, exposing its internal slice of bytes so that it’s possible to implement line parsing and such. Thanks to the object types, In_buf.t is a subtype of In.t, and same goes for Out_buf.t and Out.t.

There is also a iostream-camlzip library that implements stream encoding and decoding over these types.

Bogue, the OCaml GUI

sanette announced

I’m happy to announce a new version of Bogue (20240225). I would like to mention here two main changes:

  • This is the last version that supports SDL 2.0.9 (default in Debian 10) Next version will use tsdl 1.0.0 which requires SDL 2.0.10 or later
  • Thanks to @edwin , this version (if using SDL >= 2.0.16) is much more power-friendly (when idle). You may now leave a Bogue app open (if idle) without worrying for your laptop battery (and the environment): energy consumption is now very close to zero. (powertop indicates instantaneous power of 0mW, which I think means less than 0.1mW on my laptop)

Owl project restructured

jrzhao42 announced

Dear OCaml Community, following our previous decision to conclude the Owl project, we have been touched by the supportive and encouraging feedback from all of you. After a thorough discussion, Liang @ryanrhymes and I think it might still be for the best interest of the OCaml community to continue maintaining a solid numerical computing library. Consequently, I, Jianxin, will assume the role of project leader to ensure Owl remains maintained. Our goal is to keep Owl stable and updated, given the very limited resource we have, as explained in our previous declaration. At least we aim to keep Owl compatible with the latest stable version of OCaml.

As mentioned previously, our availability to dedicate time to Owl is limited. Achieving our objectives will require collective effort. Thus, I am looking to assemble a team of contributors eager to support both development and maintenance tasks. For details on our plans and how you can contribute, please refer to the project’s README file.

If you’re interested in joining the Owl team, taking on a specific part of the codebase, or if you have any questions, do not hesitate to contact me here or via email.

20+ ways to build an executable with foreign libs

Gregg Reynolds announced

Foreign libs can be linked into OCaml executables in a variety of ways. The pertinent info is distributed across several topics in the manual. So I put together a suite of 20-some MWEs demonstrating the options:

  • emitting native or bytecode executables
  • vm executables: freestanding or dependent on ocamlrun
  • using a static or dynamic stublib
  • linking the stublib against static or shared foreign libs
  • putting lib deps directly on the cmd line v. using -cclib or -dllib

All demos use a very simple foreign lib (in C) and stublib, and the builds are expressed in a few relatively simple makefiles.


This could be used as the basis of a proper tutorial, but I’m not sure I’ll get around to that.

(Oh crap, I forgot to update the docs. The make target names a little different. Read the makefiles. ;)

opam build and opam test: the opam plugins that simplifies your dev setup

Kate announced

Hi everyone,

I’m pleased to announce the release of opam-build & opam-test 0.2.0 (soon 0.2.4 with all the latest improvements)

These two opam plugins now require your current client to be opam 2.2 (e.g. the latest 2.2.0~beta1). If you use opam 2.2 you can install them using:

opam update && opam install 'opam-build>=0.2.0' 'opam-test>=0.2.0'

After that you can use them from any switches using:

opam build --help
opam test --help

The highlights of this version cycle are:

  • Vastly improved performance and UI
  • Added a new --global and --local command line argument to signify whether to use a local switch or a global switch
  • Add a new config file storing the user preference and which kind of switch to use by default
  • Lots of fixes and improvements

On a personal note, my main incentive with these changes was to finally use these plugins personally and in particular, while working on some packages for my work on the “OCaml 5.2 release readiness” (see a more general description of this work here), i encountered a couple of packages where the only way to compile them was using opam as they were using custom variables passed to their arguments. opam install was not what i wanted (i don’t want to install it, i just need to see if the local version compiles) but opam build fits the bill perfectly here (I don’t know what build-system it uses, i just want to compile it).

A demo of the new version (here 0.2.4) can be seen here:


Disclaimer: As with version 0.1.0, these plugins are still experimental, however they should be a lot more polished and usable, hopefully if enough people report issues (big thanks to @gridbugs for the reports on the previous versions) next version should be deemed stable.

Seeking feedback on repackaged libraries for Base

Mathieu Barbin announced

Dear OCaml community,

Lately I’ve been working on reducing dependency footprints in some of my projects, which led me to repackage some of Jane Street’s libraries that I frequently use. The goal was to make these libraries depend solely on Base, thereby making them more accessible and lightweight.

Here are the libraries I’ve repackaged so far:

These libraries required minimal modifications to remove the original dependencies from Core, Core_kernel, or Core_extended, depending on the case.

For instance, the Nonempty List library is a repackaged version of Core_kernel’s Nonempty_list. The original code can be found here. I’ve modified the code slightly to remove dependencies on Core and Core_kernel, making it solely dependent on Base. This allows the library to be used in more contexts without the need to add a dependency on Core and Core_kernel.

I’m reaching out to gauge interest in these repackaged libraries. While the use case might be niche, I believe there could be Base users who are motivated enough to limit their dependencies on core, etc.

If there’s interest in the community for these libraries, I’m considering reaching out to Jane Street to discuss options. If Jane Street isn’t interested but the community is, I’m open to moving these libraries into a community space. I’m also willing to volunteer as a maintainer in this case. Of course, I want to respect the community’s established practices and wouldn’t want to step on anyone’s toes.

If there’s no interest, I’m happy to continue as is. I’m simply offering this in case it might be beneficial to others.

I appreciate your time and look forward to your feedback!

Outreachy internship demo session

Fay Carsons announced

Hi all! Myself and the other Outreachy interns from this batch are going to be publicly demoing our projects [date=2024-03-06 time=12:00:00 timezone=“America/New_York”] !

Im going to be talking about Joy, the creative coding library I developed, going over some features and hopefully doing some live-coded generative art! The other interns will be presenting their work with Bogue and refactoring the UI of Ocaml.org

Stop by if you’d like! link

dream-html 3.0.0

Yawar Amin announced

[ANN] dream-html 3.1.0

Thanks to the efforts of Kento Okura, I am happy to announce the release of 3.1.0, which brings complete support for all standard MathML attributes and elements.


open Dream_html
open MathML

let op sym = mo [] [txt "%s" sym]

let pow i n = msup [] [
  mi [] [txt "%s" i];
  mn [] [txt "%s" n];

(* a^2+b^2=c^2 *)
let pythagoras_theorem = mtable [] [
  mtr [] [
    mtd [] [pow "a" "2"; op "+"; pow "b" "2"];
    mtd [] [op "="];
    mtd [] [pow "c" "2"];

As you can see, we can write helpers that greatly reduce duplication.

This addition completes dream-html’s support for all standard XML-based markups that are rendered by browsers.

This release also deprecates a couple of non-standard HTML attributes that I had mistakenly added before.

Add your OCaml Events to the Community Page on OCaml.org

Sabine Schmaltz announced

Hey folks!

This is a call for anyone who is running or knows about upcoming OCaml-related events to add those events to the Events directory on OCaml.org.

Here’s how to do it:

Open a pull request similar to this one:


If it’s a recurring event, create a listing in recurring.yml. If it’s a one-time event, you should omit this.

If there’s start or end times, they need to be given in UTC - so that we can, in a later improvement to the Events directory, convert them to the viewer’s local timezone more easily. Here’s an example of an event with a start time:

title: "OCaml Users in Paris (OUPS)"
textual_location: Paris, France
  lat: 48.8566
  long: 2.3522
url: https://www.meetup.com/ocaml-paris/events/299014082/
recurring_event_slug: ocaml-users-paris-oups
  yyyy_mm_dd: "7024-02-29"
  utc_hh_mm: "18:00"

Other OCaml News

From the ocaml.org blog


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.