Previous week Up Next week


Here is the latest Caml Weekly News, for the week of March 27 to April 03, 2012.

  1. Reducing boxing for floats
  2. Ocsigen Eliom 2.1
  3. New version of the binary installer for Windows
  4. Other Caml News

Reducing boxing for floats


Alain Frisch said:
I'd like to ask for the community help in evaluating the benefits of a new
strategy to control boxing/unboxing of floats in ocamlopt.

I've implemented this new strategy in the more_unboxing branch of the SVN. You
can find some description (and micro-benchmarks) there:

If numerical code is the bottleneck of one of your applications, it would be
helpful if you could you try out the more_unboxing branch (forked from the
trunk in january 2011, IIRC) and report the results on Mantis.
Dario Teixeira then replied:
Thanks for this!  I've given the 'more_unboxing' branch a brief try, using
the N-body problem from the infamous shootout as benchmark.  Below are the
results for executables compiled with 3.12.1, today's SVN trunk, and today's
'more_unboxing' branch.  The compiler options are the same as used in the
shootout; the tests consisted of 10^9 iterations on an x86_64 machine:

Version 3.12.1:

 time ./nbody.native 1_000_000_000
 1111.23user 0.13system 18:32.61elapsed 99%CPU (0avgtext+0avgdata 
 0inputs+0outputs (0major+273minor)pagefaults 0swaps

SVN trunk (2012/03/29):

 time ./nbody.native 1_000_000_000
 969.29user 0.62system 16:14.66elapsed 99%CPU (0avgtext+0avgdata 
 0inputs+0outputs (0major+273minor)pagefaults 0swaps

SVN branches/more_unboxing (2012/03/29):

 time ./nbody.native 1_000_000_000
 960.72user 0.30system 16:03.51elapsed 99%CPU (0avgtext+0avgdata 
 0inputs+0outputs (0major+272minor)pagefaults 0swaps

Though the improvement from trunk to more_unboxing is small (about 1%) and
may in fact disappear altogether if one were to run a serious statistical
analysis, the improvement from 3.12.1 to 4.00 is quite striking: about 13%!
What has changed in the compiler that would explain this?

Also, a note to those using GODI: it's fairly straightforward to have multiple
co-existing OCaml installations, making the test of trunk or experimental
branches less disrupting.  You'll find at the end the steps I used to get the
'more_unboxing' branch running.  (Note that I had to run each godi_make step
individually because of step 6, though I'm sure the GODI ninjas will find
ways to streamline this process even further.)

Best regards,
Dario Teixeira


1) Tell GODI the SVN location to checkout.
   Edit $GODI/etc/godi.conf:

  OCAML_SVN_PATH = /ocaml/branches/more_unboxing

2) cd $GODI/build/godi/godi-ocaml-src

3) godi_make clean

4) godi_make fetch

5) godi_make extract

6) GODI expects the source code directory to be called 'work/ocaml'.
   So we must do some renaming before proceeding:

  mv -T work/more_unboxing work/ocaml

7) godi_make patch

8) godi_make configure

9) godi_make build

10) godi_delete godi-ocaml-src-3.12.1godi1

11) godi_make install

12) godi_make package

13) Start godi_console and mark package godi-ocaml for rebuilding.
    This will automatically force an overall rebuild.

14) Enjoy! 

Ocsigen Eliom 2.1


Vincent Balat announced:
We are happy to announce release 2.1 of Ocsigen Eliom.
With Eliom, you can implement client-server Web applications fully in
OCaml. Client parts, delimited by a syntax extension, are automatically
extracted from the application source code and compiled to _javascript_ using
the Js_of_ocaml compiler.
Eliom also provides very powerful tools to implement classical Web sites, and
makes it possible to mix usual Web interactions with advanced client side
Main changes in this version:
Eliom project's page:
Ocsigen tutorial:
The example of the tutorial:
Ocsigen project:

New version of the binary installer for Windows


Jonathan Protzenko announced:
I've spent the past few days improving the OCaml installer for windows. This
should solve all issues that have been mentioned previously. This in
preparation for the upcoming 4.0 release ; therefore, the "beta installer"
below will install a fairly recent trunk version of OCaml.


- The installer packages a working and well-configured findlib, out of the
box. This means you can open up cmd.exe, type ocaml, then type #use
"topfind";; in the top-level.
- The installer no longer blasts the PATH variable if it is too
long. Moreover, it is now able to deal with PATHs that are up to 8192 bytes
- The installer is now able to deal with multi-user privileges: in particular,
you can use this installer on a limited account: OCaml will properly install
into your local "Application Data" folder if you don't have administrator
rights on your machine. This should be particularly useful for school
computers that run Windows.
- Various fixes: better cleanups on exit, minor fixes for OCamlWinPlus,
properly warn the user if it was unable to download ActiveTCL from the
- The installer packages a newer version of flexlink, so you shouldn't have
any more issues with gcc not accepting the -mno-cygwin option. However, the
new, official toolchain uses the mingw64 32-bit compilers. This means flexlink
will look for a i686-w64-mingw32-gcc in your path whenever you try to do
native compilation. The official, recommended way to work is to install cygwin
and its mingw64 packages. While in theory it should be possible to work within
a MSys environment, some issues [1] currently prevent you from doing so.


Please let me know if anything doesn't work as expected. This will be the
official installer for the 4.0 release.
Jonathan Protzenko later added:
Following all the good suggestions in this thread, I've updated the
installer. It now downloads and runs cygwin's setup.exe so as to provide a
fully working environment for OCaml on windows after the installer
completes. The cygwin installer runs in silent mode, that is, the progress
window shows up, but there is no user prompt.

I've also looked into odb compatibility, and it looks like after writing a few
patches, odb now runs fine on Windows. However, Oasis-generated files
do not work at all on windows. Any help in that area would be highly

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

Tracking Asynchronous IO Using Type Systems:

The topology of the set of all types:

Getting started with Snap-Auth:

Ocsigen Eliom 2.1 released:

Programming tools UX: How we made MongoDB even easier to use with Opa:

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