Previous week Up Next week


Here is the latest OCaml Weekly News, for the week of April 24 to May 01, 2018.

  1. Emacs package for automatic type display
  2. OCaml for Data Science
  3. What is a good and maintained SQL toolkit for ocaml?
  4. Patoline: an advanced typesetting written in OCaml
  5. ELPI 1.0 released
  6. Rfsm 1.0
  7. Other OCaml News

Emacs package for automatic type display


Continuing this thread, Louis Roché announced:
I recorded a short screencast to help understand what the tool is now doing:

In the list of features that I would like to add, there is also the display of
documentation. If the type is one line long and the documentation is short too,
it might be possible to display it in a nice way.
Louis Roché later added:
The repository has been updated. There is a proper readme. Including
installation and usage sections. It can be installed using quelpa, so there is
no need to clone the repository by hand. Also some bugs have been fixed.

I think this is ready for usage now. And I will try to add features.

OCaml for Data Science


Continuing this thread, Akinori Abe said:
Hi. Sorry for late reply. I'm using OCaml for data science at work.

> What makes OCaml good/bad for data science (long story short of your
> experience with OCaml in this area)?

- (Good) OCaml is fast.
- (Good) Static typing prevents many small bugs. For example, Python often shows
me errors like not found key in dict after long-time computation, but OCaml
finds them in compile time (when we use records).
- (Bad) OCaml Libraries for machine learning are less than Python.
- (Bad) OCaml cannot support multicore.

> What the OCaml alternatives for Python’s Pandas, NumPy, SciPy, etc.?

As some people mentioned, owl is similar to numpy.

> Do you know some frontier companies/products/projects that uses OCaml for data
> science?

I don't know. I use OCaml for data science personally. However, my colleagues
use their favorite languages, e.g., Java, Python, etc.

> Is there any problems that are related to data science and was solved by other
> platforms, but not by OCaml as a platform?

Lack of libraries, multi-core support and scalable distributed-memory processing
environments (I know some opam packages such as rpc_parallel, but I cannot find
enough examples).

> Maybe you may give me a good piece advise related to both OCaml and data science.

Jupyter ( is very useful and it can execute OCaml code: A Docker image containing many packages
for data science is available:, and some examples are
Please try them, if you are interested.
UnixJunkie then replied:
"OCaml cannot support multicore".
Sorry, but unless you are under windows, look for the following libraries in opam:
parmap, parany, ocamlnet, etc.
I run parallel OCaml programs everyday.
Parmap is a good start.
There are even more such libraries that I did not mention.
UnixJunkie later added:
Some people (like this person are using the OCaml
MPI bindings in production.
If you really want to create salable distributed applications, I would advize
using the zmq OCaml bindings available in opam (zmq, it would force you to
program in an agent-based style, a la Erlang).
I have done it once in the past, and it was pretty fun to write:

What is a good and maintained SQL toolkit for ocaml?


Michel Perez asked and Bobby Priambodo replied:
> I'd like to know about a good toolkit for sql handling in ocaml

If you're talking about building queries only, there's Sequoia:

If you're talking about actually interfacing with an SQL database, there's Caqti:

There are also several engine-specific libraries, such as postgresql-ocaml,
pgocaml, pgx, ocaml-mysql, etc.
Andre Nathan also replied:
There’s also sqlgg, which offers a code generation approach:

Patoline: an advanced typesetting written in OCaml


Olivier Nicole announced:
Just recently, the Patoline project ( seems to have
regained activity. Since I'm very interested in it I'm writing this post so that
others may learn about its existence.

From my experience of writing a mid-sized document (internship report) with
Patoline, the tool is very nice to use (especially for OCaml programmers) and
very promising! However, it suffers from a few shortcomings typical of free
software projects: lack of advanced documentation, and obligation for the user
to learn about the software's internals when they want to customize their
rendering in unusual ways.

I hope to find some time to contribute to Patoline this year!

ELPI 1.0 released


Enrico Tassi announced:
We are proud to announce the immediate availability of ELPI 1.0.

ELPI stands for Embeddable λProlog Interpreter, and is implemented in OCaml.

ELPI implements a variant of λProlog enriched with Constraint Handling Rules,
a programming language well suited to manipulate syntax trees with binders.

ELPI is designed to be embedded into larger applications written in OCaml as
an extension language. It comes with an API to drive the interpreter and
with an FFI for defining built-in predicates and data types, as well as
quotations and similar goodies that come in handy to adapt the language to the

The ELPI programming language has the following features:

- Native support for variable binding and substitution, via an Higher Order
  Abstract Syntax (HOAS) embedding of the object language. The programmer needs
  not to care about De Bruijn indexes.

- Native support for hypothetical context. When moving under a binder one can
  attach to the bound variable extra information that is collected when the
  variable gets out of scope. For example when writing a type-checker the
  programmer needs not to care about managing the typing context.

- Native support for higher order unification variables, again via HOAS.
  Unification variables of the meta-language (λProlog) can be reused to
  represent the unification variables of the object language. The programmer
  does not need to care about the unification-variable assignment map and
  cannot assign to a unification variable a term containing variables out of
  scope, or build a circular assignment.

- Native support for syntactic constraints and their meta-level handling rules.
  The generative semantics of Prolog can be disabled by turning a goal into a
  syntactic constraint (suspended goal). A syntactic constraint is resumed as
  soon as relevant variables gets assigned. Syntactic constraints can be
  manipulated by constraint handling rules (CHR).

- Native support for backtracking. To ease implementation of search.

- The constraint store is extensible.  The host application can declare
  non-syntactic constraints and use custom constraint solvers to check their

- Clauses are graftable. The user is free to extend an existing program by
  inserting/removing clauses, both at runtime (using implication) and at
  "compilation" time by accumulating files.

ELPI is free software released under the terms of LGPL 2.1 or above.

See for installation instructions.

Rfsm 1.0


Jocelyn Sérot announced:
This is just to announce that the OPAM package (including the library and the CL
compiler) is now available at

Thanks for the OPAM maintainer(s) for the help during the publication process.

Other OCaml News

From the ocamlcore planet blog:
Here are links from many OCaml blogs aggregated at OCaml Planet,

Full Time: Software Developer (Functional Programming) at Jane Street in New York, NY; London, UK; Hong Kong

Full Time: Compiler Engineer at Jane Street in New York & London

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 online.

Alan Schmitt