OCaml Weekly News

Previous Week Up Next Week


Here is the latest OCaml Weekly News, for the week of March 17 to 24, 2020.

Table of Contents

Luv 0.5.1 — a libuv binding — Windows support

Anton Bachin announced

I am pleased to announce release 0.5.1 of Luv. The main change is the addition of Windows support, which makes Luv fully cross-platform.

Accordingly, Luv 0.5.1 is now installable from both the main opam repo, and from opam-repository-mingw.


Also, as a side effect of the build system refactoring that was needed to support Windows, Luv's build system no longer requires Python, and supports cross-compilation.

The other noteworthy change in release 0.5.1 is a routine upgrade of the vendored libuv to its latest version, 1.35.0.

resto 0.2 released

Raphaël Proust announced

Releases of resto 0.3 and 0.4

On behalf of Nomadic Labs, I'm happy to announce the release of versions 0.3 and 0.4 of resto. Both versions are available through opam and available on https://gitlab.com/nomadic-labs/resto.

The main change in 0.3 is to depend on json-data-encoding, the fork of the unmaintained ocplib-json-typed.

The changes of 0.4 are more invasive and require users changes:

  • handle the new `Gone response code, and
  • pass gettimeofday manually.

This last feature removes a dependency from resto-cohttp to Unix, and thus helps with use within a js_of_ocaml environment.

Bisect_ppx 2.0.0 — code coverage for OCaml with nice HTML reports

Anton Bachin announced

I am pleased to announce release 2.0.0 of Bisect_ppx, the OCaml coverage tool, which helps you see which parts of your code are not being tested.


This release is a major upgrade. The highlights are:

  • Support for BuckleScript, js_of_ocaml, and esy. In other words, Bisect_ppx now compiles to both native code and JS, and is published in both opam and npm.
  • The ability to send reports automatically from Travis and CircleCI to Coveralls and Codecov. More integrations can be added over time.
  • The awkward (*BISECT-IGNORE*) comments for excluding code from instrumentation have been replaced by AST attributes like [@coverage off] (https://github.com/aantron/bisect_ppx#Exclusion).
  • A new, more principled instrumentation algorithm.
  • A new reporter command line based on Cmdliner. Run bisect-ppx-report --help to get started with it.
  • Syntax highlighting.

You are invited to peruse the all-new README for details :)

Several features have been deprecated; mostly command-line flags. You can see the list in the Deprecations section of the changelog. However, it may be easier to simply try using Bisect_ppx as before – it will warn you if you use a deprecated flag. The deprecated flags will be removed in Bisect_ppx 2.1.0, expected around July 2020.

Happy testing!


OCaml 4.09.1 released

octachron announced

We have the pleasure of celebrating the anniversary of the first spacewalk, conducted by Alexei Leonov, by announcing the release of OCaml version 4.09.1. This is mainly a bug-fix release, with a handful of configuration fixes and a GC fix backported from 4.10.0 . See the list of changes below for more details.

It is (or soon will be) available as a set of OPAM switches, and as a source download here:


Changes in 4.09.1:

  • #9073, #9120: fix incorrect GC ratio multiplier when allocating custom blocks with caml_alloc_custom_mem in runtime/custom.c (Markus Mottl, review by Gabriel Scherer and Damien Doligez)
  • #8855, #8858: Links for tools not created when installing with –disable-installing-byecode-programs (e.g. ocamldep.opt installed, but ocamldep link not created) (David Allsopp, report by Thomas Leonard)
  • #8947, #9134, #9302: fix/improve support for the BFD library (Sébastien Hinderer, review by Damien Doligez and David Allsopp)
  • #8953, #8954: Fix error submessages in the toplevel: do not display dummy locations (Armaël Guéneau, review by Gabriel Scherer)
  • #8965, #8979: Alpine build failure caused by check-parser-uptodate-or-warn.sh (Gabriel Scherer and David Allsopp, report by Anton Kochkov)
  • #8985, #8986: fix generation of the primitives when the locale collation is incompatible with C. (David Allsopp, review by Nicolás Ojeda Bär, report by Sebastian Rasmussen)
  • #9050, #9076: install missing compilerlibs/ocamlmiddleend archives (Gabriel Scherer, review by Florian Angeletti, report by Olaf Hering)
  • #9144, #9180: multiple definitions of global variables in the C runtime, causing problems with GCC 10.0 and possibly with other C compilers (Xavier Leroy, report by Jürgen Reuter, review by Mark Shinwell)
  • #9180: pass -fno-common option to C compiler when available, so as to detect problematic multiple definitions of global variables in the C runtime (Xavier Leroy, review by Mark Shinwell)
  • #9128: Fix a bug in bytecode mode which could lead to a segmentation fault. The bug was caused by the fact that the atom table shared a page with some bytecode. The fix makes sure both the atom table and the minor heap have their own pages. (Jacques-Henri Jourdan, review by Stephen Dolan, Xavier Leroy and Gabriel Scherer)

Cookie 0.1.6

Ulrik Strid announced

I recently released a cookie library. It can parse and create cookie headers (list((string, string) which both Cohttp and Httpaf uses), both Set-Cookie and Cookie so it works on both client and server. It should be compliant with https://tools.ietf.org/html/rfc6265 and I have a pretty good test suite for the parsing of cookies at least.

I couldn’t find a standalone library before this so I decided to create one since I need it for my web framework, Morph.

The next step is to create and publish integrations with ocaml-session which I have started.

First release of lwt-pipeline

Raphaël Proust announced

A second release of lwt-pipeline (v0.2) is available through opam. This new release makes no change to the code and only affects the following:

  • looser constraints on versions of dune dependency,
  • tests,
  • tests are executed in CI,
  • minor documentation improvements.

Using Ocaml as scripting language - piping sh commands

Nicolas Tollenaere announced

I am trying to use ocaml to pipe the result of a command to another (I would also be interested in feeding a string or a io stream into a sh command). For example, I would like to do the equivalent of cat foo.txt | grep thing, or pipe the result of one of my ocaml function into grep.

Quite surprinsingly, neither the Stdlib or Batteries Sys modules expose any way to handle the output of Sys.command directly (I would have thought there would be optional input and output arguments defaulting to stdin and stdout, or something along that). Batteries IO module does expose a pipe function but it's not clear for me how it would interact with the Sys module. Any ideas or other modules/package I could use ?

Nicolás Ojeda Bär suggested

I think you may be interested by https://github.com/janestreet/shexp.

Nicolas Tollenaere then said

@grayswandyr @nojb Thanks for the suggestion. I just found shcaml http://tov.github.io/shcaml/doc/ and I was going to give it a try, do you know how it compares to shexp ?

David Chemouil replied

AFAIK shcaml is unmaintained, but the approach is very nice indeed.


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.