OCaml Weekly News

Previous Week Up Next Week


Here is the latest OCaml Weekly News, for the week of September 14 to 21, 2021.

Table of Contents

opam-grep: search through the sources of all the packages in opam-repository

Kate announced

I've just released opam-grep.0.2.0 with quite a bit of change compared to the previous version. Here is the highlight:

  • Complete rewrite from shell script to OCaml, making it more portable
  • Use the faster ripgrep and ugrep over grep when available (suggestion by @Engil)
  • Use the progress library to show progress instead of a non-portable/DIY spinner

See the changelog for the full list of relevant changes.

Big thanks to @CraigFe for the progress library (such a treat!) and to @dbuenzli for bos and cmdliner in particular, making it easy to do such rewrite :relaxed:

Hardcaml MIPS CPU Learning Project and Blog

Alexander (Sasha) Skvortsov announced

Hi everyone! We are excited to announce that we have completed this project and blog. Progress has been slow these past few months due to work, internships, and college, but we’ve now released v1.0.0 on GitHub. We also published posts on:

Finally, we published a conclusion blog post, which wraps up some strengths/weaknesses of Hardcaml, as well as some takeaways on OCaml and blogging more generally.

Thank you to @andyman and @fyquah95 for building Hardcaml, and for helping us out on GitHub issues! We really appreciate your time and suggestions.

Overall, we’ve come to the conclusion that Hardcaml is a much better tool for hardware design than Verilog. This has been a great experience, and we walk away with a better understanding of hardware, functional programming, and technical writing.

Puzzling through some GADT errors

Deep in this thread, gasche said

Not exactly what you are asking for, but @Octachron wrote an excellent chapter on GADTs in the OCaml manual, which could be recommended to people starting GADT programming. It explains why recursive functions on GADT need "explicit polymorphic annotations" in less "implementation driven" terms.

(The chapter also demonstrates the new naming scheme for existential type variables introduced by GADT constructors, which can help a lot working through type errors, but are still a bit heavy and deserve a gentle introduction.)

octachron then added

I have only written the nomenclature part and a bit of the explanation for recursive functions in this chapter, @garrigue is the author of most of this chapter.

Parany for multicore OCaml

UnixJunkie announced

There is now an implementation using multicore-OCaml in the 'domains' branch.


People are very welcome to give it a try and share the speedup they observe, especially compared to fork-based parallelism.

Thanks to @nilsbecker for having motivated me.

UnixJunkie later added

If you don't use the domains branch, then parany is using fork-based parallelism. If you want to use the domains branch, you need to install multicore-ocaml first:

opam switch create 4.12.0+domains
eval `opam config env`

OCaml 4.13.0, second release candidate

octachron announced

The release of OCaml 4.13.0 is expected for next week.

Since we had a native code generation bug fix and two minor configuration tweaks since the first release candidate, we are publishing a second release candidate. If you find any bugs, please report them here:


Happy hacking, Florian Angeletti for the OCaml team.

Installation instructions

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

opam update
opam switch create 4.13.0~rc2 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git

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> --packages=ocaml-variants.4.13.0~rc2+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 4.13.0~rc2+flambda+nffa

All available options can be listed with "opam search ocaml-option".

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

Changes since the first release candidate

  • #10626, #10628: Wrong reloading of the x86-64 instruction for integer multiplication by a constant, causing the assembler to reject the ocamlopt-generated code. (Xavier Leroy, report by Dave Aitken, review by Vincent Laviron)
  • #10176, #10632(new in rc2): By default, call the assembler through the C compiler driver (Sébastien Hinderer, review by Gabriel Scherer, David Allsopp and Xavier Leroy)
  • #10451, #10635(new in rc2): Replace the use of iconv with a C utility to convert $(LIBDIR) to a C string constant on Windows when building the runtime. Hardens the generation of the constant on Unix for paths with backslashes, double-quotes and newlines. (David Allsopp, review by Florian Angeletti and Sébastien Hinderer)

Unicode 14.0.0 update for Uucd, Uucp, Uunf and Uuseg

Daniel Bünzli announced

Unicode 14.0.0 was released on the 14th of september.

It adds 838 new characters to the standard including, for our friends from Central Asia, support for Old Uyghur. For information about all the other additions, see the announcement page.

Accordingly the libraries mentioned at the end of this message had to be updated, consult the individual release notes for details. Both Uucd and Uucp are incompatible releases sinces new script and block enumerants had to be added.



P.S. Though I'm not very fond of the concept, I recently enabled sponsors on my github account as an experiment. So I'd like to thanks my github sponsors, @davesnx became the first one monday.

Set up OCaml 2.0.0-beta4

Sora Morimoto announced


  • Set OPAMSOLVERTIMEOUT to 1000 to avoid a timeout even if the opam solver is slow.
  • Increase cache hit ratio by loosening restore keys of opam cache.


Become an Outreachy Mentor: support the growth and diversity of the OCaml community

Sonja Heinze announced

Hey all, I've just submitted an Outreachy project for the winter round. The project is to write the basic ppx_deriving plugins in ppxlib; that is, the ones that don't already have a version based on ppxlib. I think both, having them available to use, and having their code available as simple examples of how to use Ppxlib.Deriving would be very nice! And improving ppxlib's documentation and finding simple issues on already existing PPXs to prepare for Outreachy, will be beneficial as well.

Of course, it's not clear if someone with the right interest comes along for this project, but if we don't find an intern for it this round, I can just re-submit the same project next round.

Sonja Heinze

Btw, the deadline to submit projects was extended and is now Sept 23rd. So the timeline in our post above is slightly outdated.

The OCaml 4.13 preview for Merlin is now available

Continuing this thread, Kate announced

The OCaml 4.13 preview for ocaml-lsp-server is now available as well.

To install it along with the OCaml 4.13 rc, please refer to the first post.

If you encounter any problems while using ocaml-lsp-server, please feel free to report it directly in https://github.com/ocaml/ocaml-lsp/pull/506


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.