OCaml Weekly News

Previous Week Up Next Week

Hello

Here is the latest OCaml Weekly News, for the week of April 07 to 14, 2026.

Table of Contents

Call for presentations: Caml in the Capital II

Sacha Ayoun announced

Hi everyone :waving_hand:

Following the success of the last event, we're organising a second edition of Caml In the Capital (happening in London). From talking to the attendees at the first event, we will be doing shorter talks and more socialising 🍕

So far, we are aiming for May 14th, to be confirmed once we have secured a venue. Please let us know if this is clashing with another big event off our radar.

Once we confirm the date and presentations, we'll post here and on the dedicated Zulip channel as well as our website.

Call for presentations

We're looking for talks that are of interest to the entire OCaml community. Topics includes (but are not limited to):

  • OCaml tooling (build systems, package management, lsp, documentation…)
  • The cool library you're working on
  • Your OCaml-related research (as long as you make it accessible for people outside your field)
  • Some piece of the OCaml ecosystem that you'd like people to hear about (ocaml.org, the OCaml Software Foundation, …)
  • Your industrial use of OCaml
  • etc.

If you’d like to give a talk, please message me or @Alistair directly with a title and short abstract.

List your open OCaml positions on the OCaml.org job board

Continuing this thread, VikasK announced

I would like to post this job that we are hiring for.

YAMLx: pure-OCaml YAML 1.2/1.1 library

Martin Jambon announced

Hello,

I'm excited to announce the availability of YAMLx, a complete implementation of the YAML 1.2 and 1.1 standards. It is intended to support most uses of YAML including its use as a configuration file format in new applications and analyzing YAML files of other applications.

For a fuller description, check out the release notes.

Get started with opam install yamlx. Then use the yamlx companion command to check that it parses and interprets your favorite YAML files correctly.

Here's an example showing the use of the library to convert YAML to JSON:

(* Read YAML from stdin with YAMLx, print JSON to stdout with Yojson

   This is a demo showing how to use the YAMLx library with the default
   settings. 'YAMLx.Values.one_of_yaml_exn' offers options to restrict
   the input language or to force the interpretation as YAML 1.1 instead of
   YAML 1.2.

   Compile with:
     ocamlfind opt -o yaml-to-json \
       -package yamlx,yojson -linkpkg yaml_to_json.ml
*)

open Printf

let rec yojson_of_yamlx (x : YAMLx.value) : Yojson.Safe.t =
  match x with
  | Null _ -> `Null
  | Bool (_, x) -> `Bool x
  | Int (_, x) -> `Intlit (Int64.to_string x)
  | Float (_, x) -> `Float x
  | String (_, x) -> `String x
  | Seq (_, xs) -> `List (List.map yojson_of_yamlx xs)
  | Map (_, xs) ->
      `Assoc (List.map (fun (loc, k, v) ->
        match (k : YAMLx.value) with
        | String (_, k) -> (k, yojson_of_yamlx v)
        | _ ->
            ksprintf failwith "%s: only string keys are supported"
              (YAMLx.default_format_loc loc)
      ) xs)

let () =
  YAMLx.register_exception_printers ();
  stdin
  |> In_channel.input_all
  |> YAMLx.Values.one_of_yaml_exn
  |> yojson_of_yamlx
  |> Yojson.Safe.pretty_to_channel stdout
  |> print_newline

Funding

YAMLx is currently released under the AGPL. There is an ongoing fundraiser: once a funding goal is reached, the license will switch to the permissive ISC license for everyone. Donors above a certain threshold receive an immediate commercial license. See my GitHub Sponsors profile for details.

ocaml-letsencrypt, an OCaml way to get TLS certificates

Calascibetta Romain announced

I am delighted to announce the release of ocaml-letsencrypt (version 2.1.0). This version introduces a new API that allows it to operate independently of a scheduler and an HTTP client. It is also a rewrite using our brand-new jws library, which now utilises the jsont library (rather than yojson).

ocaml-letsencrypt implements challenges needed to obtain a certificate via the three ways: DNS, HTTP and ACME-TLS. It therefore enables a website deployment strategy (implemented with Vif, for example) to be provided entirely in OCaml.

We use it within our cooperative for projects such as:

  • dns-letsencrypt-secondary, a unikernel that acts as a secondary DNS server capable of performing the DNS challenge for a specific domain and generating the certificate and private key. It generally works in tandem with our primary-git, our primary DNS server.
  • contruno, a unikernel that acts as a TLS reverse proxy and is capable of performing HTTP challenges. The latter is currently being completely rewritten using mnet.

Good luck with deploying your websites, and happy hacking! Here’s hoping that jws also finds its place as a library within the OCaml ecosystem.

New release of OCaml LSP 1.26.0 and Merlin 5.7.0-504

PizieDust announced

Hi everyone,

We are happy to announce the double release of merlin 5.7.0-504 and ocaml-lsp 1.26.0.

The new releases contains exciting changes such as improvements to type enclosing behaviour on various class and object related items, signature help improvements and several several bug fixes.

Please do not hesitate open issues on our bug trackers if you encounter any problems:

OCaml YAML library

Continuing this thread, Martin Jambon announced

2026 update:

  • in December 2025, @avsm created a pure-OCaml YAML library in just one day using an AI agent and wrote about it.
  • in April 2026, I did something similar and took the time to make it a complete, production-grade 1.2/1.1 YAML library called YAMLx that I announced here.

I18n 5.0 — Internationalisation made easy for any OCaml app

Vincent Balat announced

The Ocsigen team is happy to announce the release of ocsigen-i18n 5.0, a small but practical internationalisation library for OCaml.

The big change in this release: ocsigen-i18n is no longer tied to Eliom. It can now be used in any OCaml project, with optional extensions for Tyxml and Eliom when you need them.

Ocsigen-i18n was initially written by @sagotch from Be Sport. This release has been made possible thanks to the work of Habib, funded by IRILL.

opam install ocsigen-i18n

How it works

Translations are written in a plain TSV file (one key per line, one column per language):

foo                 This is a simple key.        Ceci est une clé toute simple.
a_human             a human                      un humain
bar                 I am {{x}}.                  Je suis {{x}}.
baz                 There {{{c?are||is an}}} apple{{{c?s||}}} here!  Il y a {{{c?des||une}}} pomme{{{c?s||}}} ici !
bu                  I am {{x %s}} ({{n %d}}).    Je suis {{x %s}} ({{n %d}}).

The mini-templating language supports:

  • {{x}} a string variable ~x
  • {{x %d}} a typed variable using the given format specifier
  • {{{c?yes||no}}} an optional boolean ?c switching between two strings

Then in your code, a PPX extension turns [%i18n key] into the right call:

print_endline [%i18n foo];
print_endline [%i18n bar ~x:[%i18n a_human]];
print_endline [%i18n baz ~c:(nb > 1)];
print_endline [%i18n bu ~x:"Jean-Michel" ~n:42];

(* Switching language explicitly *)
print_endline [%i18n foo ~lang:My_i18n.Fr];

The current language is held in a mutable reference you can swap (or replace with an Eliom scoped reference if you need per-session/tab languages).

Dune integration

The tool plugs into Dune very naturally. Generate the OCaml module from your TSV file with a rule:

(rule
 (target example_i18n.ml)
 (deps example_i18n.tsv)
 (action
  (run %{bin:ocsigen-i18n} --languages en,fr --input-file %{deps}
                           --output-file %{target})))

And wire the PPX in your library/executable:

(preprocess (pps ocsigen-i18n -- --default-module Example_i18n))

That’s all you need for a plain OCaml project.

Tyxml support

Pass --tyxml to the generator and the same [%i18n key] expression now produces a list of Tyxml HTML elements instead of a string:

(* Builds an HTML fragment, ready to drop into a Tyxml tree *)
let greeting = [%i18n bar ~x:[%i18n a_human]]

Variables can themselves be lists of HTML nodes, so you can mix translated text with markup naturally:

[%i18n bar ~x:[ txt "Jean-Michel ("
              ; txt (string_of_int id)
              ; txt ")" ]]

If you need a plain string in Tyxml mode (for an attribute, for instance), just prefix with S.:

[%i18n S.bar ~x:[%i18n S.a_human]]   (* string output *)

Eliom support

For client–server Eliom apps, pass --eliom. The generator emits an .eliom file (so the same translations are available on both sides), implies --tyxml, and adds [@@deriving json] on the language type so you can serialise it across the wire:

(rule
 (target example_i18n.eliom)
 (deps example_i18n.tsv)
 (action
  (run %{bin:ocsigen-i18n} --eliom --languages en,fr --input-file %{deps}
                           --output-file %{target})))

Multiple TSV files

You can split translations across several files. The PPX uses your module path to find the right one:

[%i18n foo]                          (* default module *)
[%i18n MyI18n.foo]                   (* MyI18n.foo *)
[%i18n MyI18n.S.bar ~x:[%i18n S.foo]]

Optional --prefix / --suffix flags let you keep call-sites concise ([%i18n Feature.foo] → Pr_Feature_i18n.foo ()).

Happy translating!

ATD 4.1.0 - now with YAML support

Martin Jambon announced

ATD now has OCaml support for conveniently reading data from YAML files as well as from other formats with minimal effort. It means:

  1. You define a type for your config data.
  2. atdml --mode jsonlike app_config.atd generates the OCaml code that converts a JSON-like AST containing source locations into your config data structure.
  3. Your program loads a YAML file, converts it to a JSON-like tree, and then calls the generated function to translate it into an OCaml data structure.
  4. Your application prints useful error messages if the config is malformed or incomplete.

An example is included in the distribution. It uses the recently released YAMLx library.

Note that YAMLx needs generous sponsors to fund the work that was done and unlock a permissive ISC license for everyone. Or you can accept the terms of the AGPL license if you're happy to share your application's source code with the users.

Other input file formats or other YAML libraries can be used similarly with minimum effort as long as source locations are available. For this, you'll need a bridge that converts your AST into the JSON-like AST.

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