Previous week Up Next week


Here is the latest OCaml Weekly News, for the week of September 08 to 15, 2015.

  1. Dynlink
  2. OCaml to Readable Javascript Playground
  3. 20th anniversary
  4. New ocamlbuild manual -- a usable draft
  5. Quick Check like testing for OCaml?
  6. new mailing list for ocaml-containers users and developers
  7. Job: OCaml Engineer in Nancy, France
  8. Other OCaml News



Sébastien Hinderer asked and Gabriel Scherer replied:
> It seems that, at least at some point in the past, Dynlink was not
> available everywhere. For instance as far as I could see it seems it was
> available for byte-code only. Is that correct? And if so, since which
> OCaml version is Dynlink available for both byte-code and native-code?
> Are there other environments in which Dynlink is not supported?

According to the Changes file,
native dynlink was first introduced in 3.11.0, released in December 2008.

Its support depends on both the operating system and the architecture.
For example, natdynlink was only supported on ARM machines starting
from 4.00 (July 2012).

The current configuration code is available at
It seems to be currently supported on most x86 and x86-64 systems, but
only on Linux for PowerPC and Sparc, and only on Linux and FreeBSD for
Sébastien Hinderer then asked and Xavier Leroy replied:
> Is there a way for a configure script to programmatically determine the
> availability of the feature on one given platform?

Just check for the presence of dynlink.cmxa in OCaml's standard
library directory.
Sébastien Hinderer then said and Gerd Stolpmann replied:
> So am I correct that the question ``is Dynlink supported'' only makes
> sense when one compiles a native-code program, because this always works
> for byte-code?

The question makes also a lot of sense for bytecode, because not all
platforms can load dll's. Bytecode that does not need additional dll's
can always be loaded.

On the command-line you can check with something like

echo '' | ocaml unix.cma -stdin

(unchecked, let's hope the error is correctly propagated). E.g. an
unsupported platform used to be Cygwin.
Sébastien Hinderer then asked and Gerd Stolpmann replied:
> Okay, that's indeed a very important clarification. Thanks.
> Bytecode that does not need addiional dlls means bytecode that does not
> require any Clibrary, right?

...not any _additional_ C library. If the C library is already
(statically) linked into the main executable, the loaded bytecode can
use it.

> Does somebody know what are the platforms that can not load dlls?

From "configure" I guess that the following platforms can load, and any
other cannot: all Win32 (incl Cygwin and MinGW), Linux, FreeBSD,
OpenBSD, NetBSD, DEC alpha, Solaris, IRIX, Mac OS X. The others are
nowadays very exotic (e.g. HP-UX), or special (e.g. the iOS support I'm
preparing in a separate patch won't include dll support - Apple does not
permit apps to use shared libraries).

OCaml to Readable Javascript Playground


Bob Zhang announced:
(Disclaimer: This is my personal project at home, does not represent my
current employer's opinions)
I made a OCaml to Readable Javascript Playground
( you may find interesting, you can do live
coding inside the browser and see the output of Javascript immediately.
It's still in very early stage, but it already supports the full language
(with tons of bugs). Javascript is a truly amazing platform(not just in
browsers, Bloomberg has millions lines of in-house Javascript code embedded!)
and interests me a lot recently.
The motivations is listed as below:
1. Readable (at least most skeletons are preserved), so that we can make use
of existing Javascript tools, for example, I can use webstorm as GUI debugger
to debug my OCaml code.
2. Easy FFI, all OCaml functions are plain Javascript functions, I borrowed
some ideas from Alain (gen_js_api), so if you want to call Javascript from
OCaml, just annotate types, even better, minimal code is generated, the user
can call the function on the fly.
3. (working on) Dev mode/Release mode. Another work on the road map is do
optimizations on lambda layer, cross module inlining, data flow anaylsis,
global dead code elimination.
4. (to-do) Compile OCaml objects into Javascript Objects, better FFI for
existing Javascript code base.
There are some changes needed from OCaml compiler, but those changes are
non-intrusive and mostly just pass down more information from front-end, I
would clean up and submit some patches when it's ready. If we do some
refactoring for the OCaml compiler (mostly use inline records instead of
tuples for typedtree, that will the maintainance much easier in the future)
Any feedback is welcome!
Raphaël Proust then asked and Bob Zhang replied:
> > It's still in very early stage, but it already supports the full
> > language (with tons of bugs).
> Is there a place to report more of those?
Yes, there is!, but bear with me that I might not fix those
bugs quickly since I can only spend some of my personal time in it : -)

20th anniversary


Xavier Leroy announced:
Twenty years ago to this day, on Sept 12th 1995, the mail below announced
the availability of Caml Special Light 1.06.  This was the first public
release of the programming language and system that was to become Objective
Caml, then OCaml.

All the Caml Special Light language design is still there today in OCaml;
likewise, parts of the implementation are clearly recognizable in the latest
OCaml sources.  However, in 20 years, the language picked up many language
features that were open research problems in 1995, such as objects and
classes with type inference, polymorphic variants, first-class polymorphism,
and first-class modules.  Likewise, the implementation, initially targeted
to Unix workstations, is now running on an amazing variety of platforms,
from $35 Raspberry Pi to mainframes with 1 TB of RAM to cloud distributed

The most spectacular evolution of those 20 years is certainly the growth of
the user's community and programming ecosystem.  Many application areas of
OCaml were not expected, such as financial applications and systems
programming; others, such as Web programming and bioinformatics, did not
even exist in 1995.  Likewise, the amount of freely available libraries,
programming tools, programming environments, teaching material, and
infrastructure (OPAM & the Platform) is well beyond my wildest dreams of the
time.  A big "thank you" to the great many people who contributed to this

Far from slowing down, OCaml's development has been picking up momentum
recently.  The next 20 years of OCaml will be exciting indeed!

- Xavier Leroy, on behalf of the core Caml development team

From: Xavier Leroy <>
Message-Id: <>
Subject: Release 1.06 of Caml Special Light
Date: Tue, 12 Sep 1995 11:27:13 +0200 (MET DST)

Announcing Caml Special Light 1.06, the first public release of the
Caml Special Light system.

Caml Special Light is a complete reimplementation of Caml Light that
adds a powerful module system in the style of Standard ML. The module
system is based on the notion of manifest types / translucent sums; it
supports Modula-style separate compilation, and fully transparent
higher-order functors (see the papers in the POPL 94 and 95

Caml Special Light comprises two compilers: a bytecode compiler in the
style of Caml Light (but up to twice as fast), and a high-performance
native code compiler for the following platforms:

        Alpha processors: DecStation 3000 under OSF1
        Sparc processors: Sun Sparcstation under SunOS 4.1 or Solaris 2
        Intel 386 / 486 / Pentium processors: PCs under Linux
        Mips processors: DecStation 3100 and 5000 under Ultrix 4

The native-code compiler delivers excellent performance (better than
Standard ML of New Jersey 1.08 on our tests), while retaining the
moderate memory requirements of the bytecode compiler.

Caml Special Light is still in the experimental state: the base
language has changed and will change again in significant ways,
source-level compatibility is not ensured, the implementation is
alpha-release quality, and many Caml Light tools and libraries have
not yet been ported to Caml Special Light. The present release is
targeted towards testers, adventurous souls, and users with strong
interest in modules and high-performance compilation; other users are
encouraged to stay with Caml Light 0.7 for a while.

The source distribution (for Unix machines only) is available by
anonymous FTP on, directory lang/caml-light.

More information on Caml Special Light is available on the World Wide
Web, at

Bug reports and technical questions should be directed to For general questions and comments,
use the Caml mailing list (to subscribe:

- Xavier Leroy

% Caml Special Light                  "Taste Caml in a whole new Light" %
%                                          %
% Projet Cristal, INRIA, B.P.105, 78153 Le Chesnay, France.             %

New ocamlbuild manual -- a usable draft


Gabriel Scherer announced:
In August 2013 I started working on-and-off (mostly off) on a new
ocamlbuild manual, given that many users were not satisfied with the
existing documentation.

The project is now reaching a state where I think it should be usable
by any ocamlbuild user as a documentation starting point. I am
thinking of "releasing" it in the following weeks/months by pushing it
in a more authoritative place than a personal github repository.

More than ever, I am highly interested in feedback and contributions
on this manual.

(I think the manual still lacks some content that I initially planned
to include. In particular, I would like to eventually have a skeleton
of example of a project with a non-trivial mix of C and OCaml code. I
myself don't know much about these so I didn't delay a "release" for

In the course of writing this manual I have done some improvements to
ocamlbuild's auto-documentation engine (the -documentation
command-line flag) to support parametrized flags, which are not part
of a released ocamlbuild version (feedback welcome on ) and extended some of the
.mli documentation (to which Cristophe Troestler had already made
great contributions, PR#5243) with examples of tags/rules declarations
for plugin authors.

Quick Check like testing for OCaml?


Keiko Nakata asked and Török Edwin replied:
> I am looking for (reasonably matured and hopefully easy to install)
> QuickCheck-like property based testing software for OCaml code.
> Any information is appreciated!

There is qcheck.0.4, quickcheck.1.0.2 and kaputt.1.2 on opam. 
qcheck has documentation in the mli, integration with OUnit and quite easy to get started with.
Kaputt also has reducers (to produce smaller counterexamples), and
SmallCheck-like enumeration tests.

I haven't tried quickcheck, and haven't found an equivalent to SmartCheck's
counterexample generalization [1]

Simon Cruanes also replied:
There is also qtest (also called iTeML on github) which is a bit
special: it's a testing framework providing unit testing through OUnit,
and simple random testing; its specificy is that tests can be written in
comments within the module to test, so that the code itself has no additional
dependencies or code bloat due to tests. It is very easy to write new
tests, since you don't have to add specific test modules.
It is used, afaik, at least in Batteries and in containers.

I am probably going to work on making qtest and qcheck a bit closer, if
qtest's developper(s) agree.

new mailing list for ocaml-containers users and developers


Simon Cruanes announced:
Since the ocaml forge has spam issues
( and people
seem to have had problems registrating to the mailing list I created,
I asked for a new mailing list on

The new list for containers is ,
see for more
information. Sorry for the inconvenience and noise, and thanks to the administrators.

Job: OCaml Engineer in Nancy, France


Stéphane Glondu announced:
We are looking for an OCaml developer with good OCaml and web skills to
work on the development of our Internet voting platform, Belenios [1].
A job description (in French) can be found at [2].

Please contact me for more information!


Other OCaml News

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

OCamlCore Forge Projects: darckup

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