Previous week Up Next week


Here is the latest OCaml Weekly News, for the week of May 23 to 30, 2017.

  1. BuckleScript 1.7.4
  2. New version (1.3) of interval programming library
  3. utop 2.0.0
  4. From the OCaml discourse
  5. Ocaml Github Pull Requests

BuckleScript 1.7.4


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

Main highlights:

1) Create a BuckleScript project and build it in a single command(works on all
platforms with zero dependencies including Windows)
  npm install -g bs-platform && bsb -init hello && cd hello && npm run build

2. Adding several modules to Js namespace, including Option, Result, List and
Vector. Note it is still work in progress, but these libraries are optimized for
both performance and size, they can provide an even smaller code size than
current case.
Currently the BuckleScript compiler can already output very small JS size, the
Mario Game(, only cost 7K gzipped JS size,
with a specialized library, we believe it will generate even smaller and more
efficient JS code.

Documentation is available here:

A list of changes:

Happy hacking in OCaml!  -- Hongbo


New version (1.3) of interval programming library


Jean-Marc Alliot announced:
Interval computation library for ocaml, version 1.3, release date 26/05/2017.
The download link is here:

This library uses assembly code to compute all operations with proper roundings
(high/low), and currently ONLY works on INTEL processors. The package has been
developped for linux systems but it looks like it is now working properly with
Windows and MacOs, and with gcc and clang.

Documentation is available in the doc/ directory in html, pdf and dvi formats.
It is extremely wise to read the whole documentation, even if you intend to only
use the interval module, because of the"strange behavior" of the x87

To build and test, read the README file in the main directory.

Tests are available in the TESTS/ directory. They are mainly for debugging
purpose and quite complicated. You may run them to check that everything is
working properly for your machine. The test program runs also a speed test
program for your particular architecture.

Examples are available in the EXAMPLES/ directory. There is a B_AND_B
sub-directory with an example of a branch-and-bound algorithm that uses interval
arithmetics for function optimization (the example is for the Griewank function,
but you can substitute any function you like).

All bug reports should be sent to:

Happy interval programming...

utop 2.0.0


Jeremie Dimino announced:
I'm happy to announce the release of utop 2.0.0. This release contains
several useful features contributed by users. The bump in major
version reflects the fact that support for camlp4 was dropped in this
release. Moreover utop no longer supports OCaml versions older than

I thank all the contributors that participated in this release by
submitting patches to utop and lambda-term:

- Andrea Richiardi
- Andrew Ray
- Christopher Mcalpine
- Deokhwan Kim
- Fabian Bonk
- Fabian Hemmer
- Leonid Rozenberg
- Léon van Velzen
- github user zhenya1007

New features

Here is the list of new features available in utop 2.0.0:

* Add `-implicit-bindings` option to automatically bind expressions to names
  `_0`, `_1` and so on. For example, `3 + 4;;` becomes `let _0 = 3 + 4;;`
  (#161, #193, Fabian Hemmer)
* Add tab completion for `#mod_use` (#181, Leonid Rozenberg)
* Mention `#help` in `#utop_help` (#190, Fabian Hemmer)
* Add `#utop_stash` and `#utop_save` to save the session to a file
  (#169, #199, Christopher Mcalpine and Fabian Hemmer)
* Add support for reason in the Emacs mode (#206, Andrea Richiardi)

And the rest of the changes:

* Fix a bug where utop wouldn't apply ppx rewriters when running in
  emacs (Bug report: #192, fix: #202, Deokhwan Kim)
* Refactor the use of hooks to support the various OCaml Emacs mode
  (#201, Andrea Richiardi)
* Drop support for camlp4/camlp5
* Drop support for OCaml <= 4.01
* Switch the build system to jbuilder
* Resurect `UTop_main.interact`

Additionally, some new features come from changes in
lambda-term. Following is the changelog for lambda-term 1.11 which was
released recently:

* Add history-search-prev and history-search-next (#47, Fabian Hemmer)
* Allow frame widgets to be labeled (#36, Andrew Ray)
* Add an alignment setting to label widgets (#36, Andrew Ray)
* Add scrollbar widgets (#33, Andrew Ray)
* Improve the `lambda-term-inputrc.5` man page (#41, Léon van Velzen)
* Allow editor widgets to request a specific size and add a "double
  editor" example (#42, Fabian Bonk)
* Add `^` to the list of characters recognized in inputrc files (#46,
  github user zhenya1007)
* Switch the build to jbuilder
* Drop compatibility with 4.01

Status and future of utop

I started utop about 8 years ago, initially distributed with lwt as
the lwt toplevel. I still regularly receive bug reports and patches
for utop and see it mentioned there and there, so I'm assuming it is
used by a substantial number of people.

Nowaways I only review pull requests and do releases but no longer do
new development myself. I would like to eventually stop working on
utop, but given that it has users I'm looking for someone to take over
the project. So if that's of interest to you, please let me know!

Note that taking charge of utop doesn't mean only doing maintainance
work; developping toplevels is a fun activity and there are a lot of
cool new features that can be added. Toplevels are used regularly by
both beginners and seasoned programmers, so they benefit the whole

On the top of my head, here are a few examples of projects that could
be interesting to work on:

* utop interact: this is an experimental feature that has existed for
  a while. However it is a bit painful to setup so it is currently
  undocumented. However, properly packaged and maybe with the help of
  a compiler plugin this could be a killer feature.

  What it allows you to do is call `UTop_main.interact ()` somewhere
  in your program. When the execution reaches this point, you get a
  toplevel in the context of the call to `UTop_main.interact`,
  allowing you to inspect the environment to understand what is

* dependency refactoring: currently utop is based on big libraries
  such as lambda-term or camomile. Nowadays UTF-8 is the norm and even
  the Windows 10 console supports VT100 like escape sequences [1]. As
  a result it would make sense to switch to more modern and lighter
  libraries such as notty [2]

* better contextual help: in a lot of places utop could provide hints
  to improve the user experience

* alternative editor support: currently the Emacs mode for utop works
  like a normal toplevel. i.e. a session is a sequence of prompts,
  inputs and outcomes that looks like this:

    utop> 1 + 1;;
    - : int = 2
    utop> 6 * 7;;
    - : int = 42

  It would be easy to change it to look like:

    1 + 1
    [@@@outcome {|
    - : int = 2
    6 * 7
    [@@@outcome {|
    - : int = 42

  Then a toplevel session would essentially become a valid .ml file
  that you can feed to the compiler and where you can use your usual
  development tools such as merlin.

And I'm sure there are a lot of other features that would make utop better.


From the OCaml discourse

The editor compiled this list:
Here are some links to messages at that may
be of interest to the readers.

- Anil Madhavapeddy talks about "Opam-ed: quickly edit opam fields from the CLI"

- Pierre Chambart talks about "nullable-array 0.1 (initial release)"

- Romain Slootmaekers talks about "arakoon.1.9.17"

- Anil Madhavapeddy talks about "Cambridge Jbuilder demo/discussion: May 25th"

- Vladimir Brankov talks about "hdf5 0.1.2"

- Andreas Garnaes talks about "graphql 0.1.0"

- Anil Madhavapeddy talks about "Cstruct 3.0.0, with packaging changes"

- Louis Gesbert talks about "opam-bundle 0.1: generate self-contained,
  distributable source package bundles"

- Vincent Balat talks about "OCaml / Ocsigen developer positions"

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.

- Remove otherlibs/num

- Printf: alternative format for integers

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