Previous week Up Next week


Here is the latest OCaml Weekly News, for the week of February 28 to March 07, 2017.

  1. BuckleScript 1.5 - First class support for Reason syntax
  2. Menhir incremental api with ocamlbuild
  3. Cmdliner 1.0.0
  4. researcher permanent position at ONERA, Toulouse
  5. Ocaml Github Pull Requests
  6. Other OCaml News

BuckleScript 1.5 - First class support for Reason syntax


Hongbo Zhang announced:
BuckleScript is an optimizing compiler for OCaml to generate readable
JavaScript, it is open sourced by Bloomberg [1].

We are glad to announce 1.5.0, Besides a number of minor bug fixes and
performance improvement, most notable changes:

# Bundled Reason together thanks to contributions from Facebook Reason team, so
that Reason syntax support is also first class, this also makes Reason for the
first time available to Windows users.

# FFI added `bs.uncurry` which will automatically uncurry the callback so the
user land API is clearer, see [2]

# Improve object label translation to cause less surprise, this might case minor
backward compatibility [3]

Documentation is available here:

To install:
npm install -g bs-platform

Let's make OCaml a trend in JavaScript community in 2017, together! -- Hongbo


Menhir incremental api with ocamlbuild


Helmut Brandl asked:
does anybody know how to build a project with ocamlbuild and use the incremental
api of menhir. By using menhir directly I would use the ‘-table’ flag. But I
don’t know how to transfer this flag to menhir by using ocamlbuild.
Gabriel Scherer replied:
Indeed, ocamlbuild misses some built-in flag for menhir features. That said, it
is easy to add these flags through your Here is what I have in
an incremental-menhir-using project (inside a dispatch call):

flag ["menhir"; "parser"; "trace"] (A"--trace");
flag ["menhir"; "parser"; "table"] (A "--table");
flag ["menhir"; "parser"; "canonical"] (A"--canonical");

but it would be easy to add those to the built-in -use-menhir mode.

(If you are not comfortable with using, see the ocamlbuild
manual: )

In this project I also have rules for handling of .messages files corresponding
Menhir's new error message support. I include the complete code at the end of my
email. I would like to get a bit more experience using those, before considering
including them in ocamlbuild proper.


module Menhir = struct
  let menhir () =
    if !Options.ocamlyacc = N then V"MENHIR" else !Options.ocamlyacc
  let menhir_tags mly =
    tags_of_pathname mly ++"ocaml"++"parser"++"menhir"
  let menhir_produce_messages env build =
    let messages, mly = env "%.messages", env "%.mly" in
    let open Ocamlbuild_pack in
    Ocaml_compiler.prepare_compile build mly;
    Cmd(S[menhir (); T (menhir_tags mly);
      A "--list-errors"; P mly; Sh ">"; Px messages])
  let menhir_compile_messages env build =
    let mly = env "%.mly" in
    let messages = env "%.messages" in
    let target = env "" in
    Cmd(S[menhir (); T (menhir_tags mly); P mly;
      A "--compile-errors"; P messages;
      Sh ">"; Px target])
  let menhir_update_messages env build =
    let mly = env "%.mly" in
    let messages = env "%.messages" in
    let tmp = Filename.temp_file "menhir" ".messages" in
    Seq [
      Cmd(S[menhir (); T (menhir_tags mly); P mly;
        A "--update-errors"; P messages;
        Sh ">"; P tmp]);
      Cmd(S[A "mv"; P tmp; P messages]);
  let dispatcher = function
    | After_rules ->
      flag ["menhir"; "parser"; "menhir_trace"] (A"--trace");
      flag ["menhir"; "parser"; "menhir_table"] (A "--table");
      flag ["menhir"; "parser"; "menhir_canonical"] (A"--canonical");
      rule "menhir: .mly -> .messages"
      rule "menhir: .mly & .messages ->"
        ~deps:["%.mly"; "%.messages"]
      rule "menhir: .mly & .messages -> .messages & .messages.update"
        ~deps:["%.mly"; "%.messages"]
    | _ -> ()
François Pottier then added:
Thanks Gabriel.

Another quick-and-dirty approach is to just use
  ocamlbuild -use-menhir -menhir "menhir --table".
Helmut Brandl finally said:
I have found another solution. The command

ocamlbuild -yaccflag —table ...

does the job. Thanks for the hints.

Cmdliner 1.0.0


Daniel Bünzli announced:
It's my pleasure to announce the release of cmdliner 1.0.0. 

One important notice for all users. The argument converter type will become
abstract in the next major release, please make sure to migrate your code to use
the constructors/destructors of the Arg module to minimize breakage in the

For the rest all the details are in the release notes [0], here's an abridged view:

* Few breaking API changes but I suspect most users won't be affected.
* Internal sanitization and modularization which hopefully now makes the code
  readable and will ease further developments.
* Documentation language sanitization.
* Additions to reduce boilerplate and ease the documentation of your 
  tool (e.g. support for documenting exit statuses). 
* Additions for better composition with Pervasives.exit and the new 
  `result` type of the stdlib.
* End-user error reporting improvements.
* Relicense from BSD3 to ISC.

Cmdliner is an ISC licensed library for the declarative definition of command
line interfaces.

API docs:



SP asked and Daniel Bünzli replied:
> Good work Daniel, thank you. Are there notes anywhere on what and how to
> migrate for version 1.0.0, or is it simply a case of using Arg constructors?

Mostly yes, you are only affected if you defined your own argument converters
and the type system won't bark in this release. The shortest fix is to wrap
existing parser-printer pairs with Arg.pconv [0].

A few projects are affected by the addition of the `Blocks case in the
Manpage.block type [1].

This should mostly be it --- higher-order users may be affected by the addition
of optional arguments to some other functions though (e.g.




researcher permanent position at ONERA, Toulouse


David Chemouil announced:
we have an open permanent position for a researcher at ONERA. The position is
located in our Toulouse (*) premises.

--> Please, do not refrain to apply if you have a strong background in formal
methods, programming language theory, logic, etc.; as well as a will to perform
research ranging from theoretical techniques to prototyping them and
experimenting with them in practice.

Please apply with a resume and motivation letter before the end of March at the
following URL:


ONERA is the French research center in civil and/or defense aeronautics & space.
Whether ONERA's research has short, medium or long-term goals, it is ultimately
designed to support the aerospace and defense industries.

The topic of research will revolve around the following:
- theoretical and practical development of formal and modelling means for safety
analysis of critical systems
- safety analyses of new systems architectures (many-core systems, wireless
networks for critical applications...)
- formal verification techniques for embedded software (drones, robots...)

The selected researcher will collaborate with academic partners as well as
industrial (Airbus, Thales, Dassault...) as well as institutional ones (French
Defence, French Space Agency..).

Expected profile for a candidate:
- fluent in English
- PhD in Computer Science
- Strong background as well as a marked taste for experimenting (/programming)
ideas and techniques in the domain of critical systems and a will to address
industrial systems.
- Strong skills in some of the following areas:
* systems safety evaluation
* formal methods (e.g.: assisted or automated proof techniques, model-checking,
static analysis, test case generation, SAT, SMT, typing...)
* architecture modelling
* systems certification

(*) To learn more about Toulouse, a vibrant city in the south of France, please
refer to

Ocaml Github Pull Requests

Gabriel Scherer and the editor compiled this list:
Here is a sneak peek at some potential future features of the Ocaml
compiler, discussed by their implementers in these Github Pull Requests.

- RFC: tail recursion modulo constructors
- Compiler primitives and standard library support for 63-bit integers
- tailrecursive (rev_) split and combine
- Make -linkall applicable to single compilation units
- Add iOS support

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

Building and Publishing an OCaml Package: Q1 2017

Functional Game Server (Gameplay) Engineer at Playstudios (Full-time)

What a Jane Street dev interview is like

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