Previous week Up Next week


Here is the latest Caml Weekly News, for the week of September 24 to October 01, 2013.

  1. Feedback on the redesign and logo
  2. Enhanced OCaml Documentation 4.01
  3. Gg 0.8.0 and Vg 0.8.0
  4. otags reloaded 4.01.1 for OCaml 4.01
  5. meetup OCaml-Pairs (OUPS), mercredi 9 octobre à l'IRILL
  6. embedding js_of_ocaml output?
  7. OUnit v2.0.0
  8. Thread behaviour
  9. Esterel Technologies is looking for an Ocaml SW developer in Toulouse (CDI)
  10. equivalent checking of ocaml program?
  11. LablGtk 2.18.0 and LablGL 1.05
  12. Uucd 1.0.0 & Uunf 0.9.2
  13. Other Caml News

Feedback on the redesign and logo


Amir Chaudhry asked:
I've just put up a blog post asking for feedback on the redesign
[1]. I'm specifically interested in getting feedback on (1) the second
iteration of the OCaml Logo and (2) the new design for See the
blog post for more information. We're tracking feedback via issues [2] and
there are some known issues already listed there.


Enhanced OCaml Documentation 4.01


Hendrik Tews announced:
I would like to announce

                 The Enhanced OCaml Documentation 
                          Version 4.01
   available via

This version of the OCaml manual enhances the original html
version in the following way:

- Changes (wrt version 4.00) are tagged with icons and color 
- an additional appendix contains all grammar rules

As always, the enhanced documentation reveals some points that
have not been mentioned in the official 4.01 announcement from
Damien Doligez. This time, the most important such point is that
the documentation approves what long-term OCaml hackers have been
using for years to improve their code. You can use an infix
symbol as for-loop-variable:

   for (+) = ... to ... do ... done

will (mostly) word as (un)expected!

Gg 0.8.0 and Vg 0.8.0


Daniel Bünzli announced:
It's my pleasure to announce the first releases of:

* Gg, a module providing basic types for computer graphics
* Vg, a declarative 2D vector graphics library.

More on these and their aim at the end of the message.  

My thanks to Edwin Török who contributed the color conversion functions
in Gg and helped with color science questions.

Besides, while I can trace my work on Vg to at least 2008 it would
still remain unreleased without the sponsorship of both Citrix Systems R&D
and OCaml Labs. Many thanks to them and to the inspiring OCaml
Cambridgian atmosphere.

Comments are welcome,


# Note on installing

Once opam 1.1 is released, the packages will be in opam's repository  
and can be installed with:

  opam install gg vg    # (SVG renderer only)
  opam install gg uutf otfm js_of_ocaml vg    # (all renderers).  

If you are eager to use the software and have the opam 1.1 beta installed  
you can get them through my unreleased software repo:

  opam repo add erratique-u
  opam upgrade
  opam install gg uutf otfm js_of_ocaml vg

these packages will be removed from erratique-u once they are in the  
opam repository.

# Gg

Gg is an OCaml module providing basic types for computer graphics. It
defines types and functions for floats, vectors, points, sizes,
matrices, quaternions, axis-aligned boxes, colors, color spaces, and
raster data.

Gg is made of a single, independent, module and distributed under the
BSD3 license.  

The aim of Gg is to provide an efficient, immutable, C friendly, type
infrastructure for computer graphics programming. It's neither a
general purpose linear algebra package nor a computational geometry
library. I hope it can serve as a minimal common ground for other
graphics libraries to exchange data without having to depend on each

From an API point of view the library is considered mostly
complete. The only thing that could still change significantly is the
support for representing raster data (Gg.raster), in any case,
consult the documentation which clarifies what may still change.

Home page:  

# Vg

Vg is an OCaml module for declarative 2D vector graphics. In Vg,
images are values that denote functions mapping points of the
cartesian plane to colors. The module provides combinators to define
and compose these values.

Renderers for PDF, SVG and the HTML canvas are distributed with the
module. An API allows to implement new renderers.

Vg depends only on Gg. The SVG renderer has no dependency, the PDF
renderer depends on Uutf and Otfm, the HTML canvas renderer depends on
js_of_ocaml. Vg and its renderers are distributed under the BSD3

The aim of Vg is to provide a low-level, declarative, composable and
semantically precise vector graphics abstraction that can be used with
multiple rendering backends. Vg is made of pure OCaml code and is thus
easy to install wherever the compiler decided to bring you.

The basics section of the documentation can be read as tutorial

The distribution has a database of sample images that serve both as a
test suite to compare the output of different rendering backends and
as a learning tool to see how images are defined in Vg. Thanks to
js_of_ocaml it can be browsed online here:

You can get to the definition of an image by clicking on the image's

From an API point of view the library is not expected to change much;
in any case the documentation clarifies what may still change. In the
future besides general backend improvements and support for a raster
image primitive, plans for the library include a pure software
rasterizer backend, an OpenGL backend and other needed improvements
around text rendering.

Take care to consult the backends documentation to be aware of their
current limitations. Do not hesitate to bug me if a particular
limitation is important to you as it may help me to direct my

Home page:  

otags reloaded 4.01.1 for OCaml 4.01


Hendrik Tews announced:
I updated otags to OCaml 4.01. You can find it at the usual place under the usual license GPL v3.

Otags reloaded generates tags tables for emacs and vi/vim.

Because of OCaml bug #6175, otags will die on sources containing
the new open! keyword. Because of this bug I highly recommend
everybody to upgrade otags as soon as you start using an OCaml
version that fixes #6175.

meetup OCaml-Pairs (OUPS), mercredi 9 octobre à l'IRILL


Fabrice Le Fessant announced:
A short message in French, to give the program of the next OCaml-Paris
meetup, on Wednesday,Octobre 9, at 19:30 at IRILL :

La prochaine rencontre du Meetup OCaml-Paris (OUPS) aura lieu le
mercredi 9 octobre à l'IRILL, comme d'habitude.

Au programme, à partir de 19h30 :
* Romain Bardou : "Procord: une librairie portable pour déléguer des
calculs à d’autres processus"
* Xavier Clerc : "Nouveautés dans OCamlJava"
* Jane Street : "Jenga: towards a correct and scalable build system"
* Adrien Nader : "Mieux comprendre et utiliser le binding LablGTK"

Nous aurons cette fois deux sponsors pour le pot qui suivra, Jane
Street et Lexifi !

Inscrivez-vous nombreux !

embedding js_of_ocaml output?


Malcolm Matalka asked and Anil Madhavapeddy replied:
> This might be a really trivial question but perusing the js_of_ocaml
> website I didn't see it answered:
> Has anyone gone about embedding js_of_ocaml in an ocaml application?
> Specifically, I want ship a binary that runs a small embedded webserver
> and provides the GUI over that. The obvious solution is just to add
> building the js_of_ocaml output in the build process then make a fake
> module that just has a string with the output in it and compile that in.
> Hacky but I don't see why it wouldn't work but I'm sure somebody has a
> clever idea out there.

'crunch' from OPAM will do what you want:

$ opam search crunch
Available packages for system:
crunch -- Convert a filesystem into a static OCaml module

(let me know if there's anything in there that's Mirage specific and
I'll fix it).

I believe 'ocamlify' also does the same thing from OASIS, but I've not
used it.

$ opam search ocamlify
Available packages for system:
ocamlify 0.0.1 Include files in OCaml code

OUnit v2.0.0


Sylvain Le Gall announced:
After 1.5 month of work, I am proud to officialy release OUnit 2.0.0.
This is a major rewrite of OUnit to include various features that I think
was missing from OUnit1. The very good news is that the port of the
OASIS test suite has proven that this new version of OUnit can
drastically improve the running time of a test suite.

You can download it here:

I have written a full blog post about this new version:

One of the best news, is that using the runner "processes" (fork process
to run test), I was able to achieve a linear speedup for the test
running time (4x lower when running with 4 shards).
Sylvain Le Gall later added:
FTR, OPAM package is available and I forget to include a short
description of what OUnit is about:

OUnit is a unit test framework for OCaml. It allows one to easily create
unit-tests for OCaml code. It is based on HUnit, a unit testing
framework for Haskell. It is similar to JUnit, and other XUnit testing
Francois Berenger also added:
The excellent OUnit is used by qtest:

The tool of choice to write tests as comments in your OCaml code.
This is used a lot in batteries' source code.

Thread behaviour


Tom Ridge asked and Xavier Leroy replied (there was much discussion about concurrency vs parallelism in this thread):
> I have a little program which creates a thread, and then sits in a loop:
>  --
> let f () =
> let _ = ignore (print_endline "3") in
> let _ = ignore (print_endline "hello") in
> let _ = ignore (print_endline "4") in
> ()
> let main () =
> let _ = ignore (print_endline "1") in
> let t = Thread.create f () in
> (* let _ = Thread.join t in *)
> let _ = ignore (print_endline "2") in
> while true do
> flush stdout;
> done
> let _ = main ()
> --
> I compile the program with the following Makefile clause:
> test.byte: FORCE
> ocamlc -o $@ -thread unix.cma threads.cma $<
> When I run the program I get the output:
> 1
> 2
> and the program then sits in the loop.

On my machine (OCaml 4.01.0, Ubuntu 12.04 LTS), I sometimes see what
you see, and sometimes I see the expected output:


It all depends on the whim of the OS scheduler. OCaml has no control
over it. And you shoudn't expect any kind of fairness from the OS
scheduler, esp. Linux's, which gladly jettisons any pretense of
fairness in the hope of getting better throughput.

> Would it be fair to say that OCaml does not currently support
> pre-emptively scheduled threads?

This would be inexact. OCaml's threads yield the runtime lock, giving
other threads a chance to grab it and run, in the following cases:

1- when performing an I/O operation that may block or take a long time
("flush" in your example)
2- when the program calls Thread.yield (duh)
3- when a timer interrupt is detected at certain program points:
3a- for native-code compilation: minor heap allocations
3b- for bytecode compilation: function calls + beginning of every
loop iteration.

What happens after yielding is the business of the OS scheduler,

> I should be using a message passing interface written in some other
> language, with bindings to OCaml.

You have plenty of options depending on what you really need in the

- For parallelism (getting speedups from a sequential program),
consider the Parmap and Functory libraries.
- For concurrency with message passing and possible distribution,
consider JoCaml.
- If you want to write your own message-passing library and want to
control every bit of the scheduling, LWT (lightweight cooperative
threads) is probably best.
- You can also use system threads, but only if you give up on any hope
of fairness and write in a style that is resistant against whatever
awful scheduling the OS will do for you.

Esterel Technologies is looking for an Ocaml SW developer in Toulouse (CDI)


Amandine Roy announced:
Esterel Technologies is looking for a software developer with experience in
physical system modeling language or tool like Simulink/stateflow,
Modelica, Simplorer, FMI, etc. A background on differential equations
system solvers, ODEs and DAEs, will be highly appreciated.

The position belongs to the Esterel team in charge of developing safety
critical qualified compilers and development tools. The development uses
mainly Objective Caml.

Don't hesitate to send me your resume:
Amandine ROY - HR Manager

Link to our web site:

equivalent checking of ocaml program?


Deep in this thread, Gabriel Scherer said:
This thread may be a good opportunity to advertize for some work on static
program verification that has been applied to OCaml (sadly, it is actually
quite rare to see program verification efforts for functional programming
languages, in large part because funding bodies and reviewers appreciate
applications to mainstream language with larger codebases). I am aware of
the following, feel free to add more suggestions:
- MoCHi
  Based on foundational work on model-checking of higher-order programs by
Ong, Kobayashi and others (see the citations of the papers on the webpage),
MoCHi can work with a subset of OCaml. It is not ready to handle real-world
programs, both in term of verification time and the ocaml feature it
understands, but going in the right direction -- and the underlying tools
are rapidly improving, see e.g. the recent work on C-SHORe
- Hybrid Contract Checking for OCaml, by Dana Xu
  (I previosuly mentioned on this list the available prototype that extends
OCaml with dynamic contract checking)

Another brand of work making good progress is the "Liquid Types" project in
San Diego ( ),
which are working on applications to Haskell.

Note that those tools are generally aimed at checking that programs respect
some safety condition (eg. "does not end in an assertion failure"), not
general specifications or general equivalence checking. You may consider
encoding general equivalence checking in these term (traverse the input
space and assert that the output of both functions are equivalent), but I
don't know if the tools can handle the encoding efficiently. If you want
full functional correctness for higher-order programs, rather than
automated safety checkers, I would probably rather look at proof-assistant
frameworks (eg. Ynot or CFML ).

LablGtk 2.18.0 and LablGL 1.05


Jacques Garrigue announced:
With a small ICFP induced delay, here comes LablGtk 2.18.0, the latest
release of the OCaml interface to the Gtk+ GUI library and friends
(gtkglarea, glade, rsvg, gnomecanvas, gnomedruid, panel, gtkspell and

It includes a number of API additions and bug fixes.

You can find it at:

A binary release for windows is included, using OCaml 4.01.

Many people contributed to this release, see the commit log for all
their names.

Together comes LablGL 1.05, the well-typed interface to OpenGL.
It can be used in combination with either LablTk (using Togl), LablGtk
(using gtkglarea), and Glut. It also comes with windows binaries.

Note that this is only a bug fix and compatibility release.
More ambitious development was committed to the multitex branch by
Didier Cassirame, and you can access it through the git repository.

Changes since LablGtk 2.16.0:
2013.10.01 [Jacques]
  * prepare release
  * update applications for 4.01
  * various fixes in windows port

2013.9.17 [Jacques]
  * add some GTK enumerations and update stock icon list
  * add properties GtkTreeView.enable_{tree,grid}_lines
  * add properties GtkEntry.{primary,secondary}_icon_{stock,name,pixbuf},
    see examples/ for usage

2013.7.29 [Pierre-Marie]
  * add tags in GtkMovementStep

2013.2.19 [Jacques]
  * fix compatibility with ocaml 4.01 (?lab for non-optional arguments)

2012.08.26 [Pierre-Marie]
  * add handling of new modifiers

2012.08.26 [Jacques]
  * detect findlib during configuration
  * support DESTDIR with findlib-install

2012.08.26 [Jacques]
  * indicate that only old-install supports DESTDIR
  * have old-install copy the META file too
  * cleanup the two phases of findlib-install

Changes since LablGL 1.05:
* make it work with the OCaml 4.01 windows installer
  (both lablglut and togl)

* add configuration file for Ubuntu

* allow building with make -j

* switch to Togl 1.7, doesn't need Tk internals anymore

* add `bgr and `bgra to Gl.format and GlTex.format (reported by Vu Ngoc San)

* fix Glut.special_of_int to raise no exception (reported by malc)

* merge glShader support by Florent Monnier

Uucd 1.0.0 & Uunf 0.9.2


Daniel Bünzli announced:
Unicode 6.3.0 having been released yesterday it's my pleasure to announce
that the following modules have been updated to support the latest version of
the standard:

# Uucd 1.0.0, Unicode character database decoder for OCaml.

This is a major release as new cases where introduced in some of the
database's enumerants.

Home page:
Release notes:

# Uunf 0.9.2, Unicode text normalization for OCaml

Minor release, updates the internal data structures to support the new
characters introduced in Unicode 6.3.0

Home page:
Release notes:

They will be available in opam as soon as opam 1.1 is out.

Other Caml News

From the ocamlcore planet blog:
Thanks to Alp Mestan, we now include in the Caml Weekly News the links to the
recent posts from the ocamlcore planet blog at

OUnit 2.0, official release:

Test your OCaml packages in minutes using Travis CI:

CCSS 1.4 released:

OCaml  tutorial videos now available:

OUnit 2.0 progress, September 2013:

Gg 0.8.0 and Vg 0.8.0:

Feedback requested on the redesign:

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