Previous week Up Next week


Here is the latest Caml Weekly News, for the week of November 01 to 08, 2011.

  1. PlasmaFS, PlasmaKV, and MapReduce, version 0.5
  2. Argot: 1.0 release
  3. Jump-to-definition and type-aware completion for Caml
  4. Is it possible to extend OCaml lexer rules via Camlp4?
  5. Other Caml News

PlasmaFS, PlasmaKV, and MapReduce, version 0.5


Gerd Stolpmann announced:
I've just released Plasma-0.5. Plasma consists now of three parts,
namely PlasmaFS, PlasmaKV, and Plasma Map/Reduce:

      * PlasmaFS is a distributed replicating filesystem. Unlike other
        such filesystems, it is transactional and exhibits transactions
        to the user. Also, it implements almost all of what is known as
        POSIX semantics, and it is mountable.
      * PlasmaKV is a key/value database on top of PlasmaFS. It is
        designed for ultra-high read workloads, and offers interesting
        properties borrowed from PlasmaFS (e.g. replication and ACID
      * Plasma Map/reduce implements a variant of the popular
        computation scheme.

The real major change in version 0.5 is the addition of PlasmaKV.
Because PlasmaFS offers a richer API than is normally available from a
filesystem, the implementation of this NoSQL db takes less than 2000
lines of code. Nevertheless, it has properties most other NoSQL db's
cannot fully implement, like complete isolation between readers and
writers (i.e. they do not lock each other out). A description of the
concept can be found here:

The extremely simple API:

The other major change in version 0.5 is the implementation of parallel
commits in PlasmaFS. A test deployment showed that it is now possible to
get around 500 commits/second.

All pieces of software are bundled together in one download. The
project page with further links is

There is now also a homepage at

THIS IS NOW A BETA RELEASE! I'm searching for testers. Whoever has
access to a cluster please check Plasma out!

Plasma is installable via GODI for Ocaml 3.12.

For discussions on specifics of Plasma there is a separate mailing list:

Argot: 1.0 release


Xavier Clerc announced:
This post announces the 1.0 release of the Argot project, whose goal
is to provide an enhanced HTML generator for ocamldoc, released under
the GPL v3.

Home page:
Preview page (for search feature):
Forge page:

Main changes since 1.0-beta:
  - new '-search' command-line switch to generate search information
    (available on HTML pages through the magnifying glass icon)
  - search by exact name
  - search by name using regular expression
  - search by type using isomorphisms (experimental)
  - new '-definitions' command-line switch to load variables from file
  - correct handling of embedded tables
  - more predefined licenses for the '@license' tag
  - some refactoring
Fabrice Le Fessant then said:
  By the way, Thomas is also working on a plugin for ocamldoc, with
incremental search. An example of what it generates (for the stdlib and
some of our internal libraries) is available here:

  It is not yet released, but we plan to do it in the next months, with
some other tools.
Anil Madhavapeddy then added:
Thomas also prototyped a searchable version for the CUFP Mirage tutorial:
e.g.: ;

but the search view does need some optimisation with a large number of 
modules, as in the standard library.  The new version he's doing in HTML is 
far slicker and faster.

Citrix have a really useful JSON output to ocamldoc in the XAPI tree that is 
very handy for anyone else who wants to do something like this:
rixed asked and Thomas Gazagnaire replied:
> This looks very promising.
> Will the tool generate mere html files or is it intended for an ocaml
> web framework such as ocsigen ?

Currently, it generates only raw HTML files. The goal is to be able to browse 
it locally (it's a bit awkward to have to run a webserver to read 

> Also, apparently one cannot search by type. It would be a nice feature
> to have.

The searching tools are quite limited currently, I'm just re-using standard 
JavaScript libraries for auto-completion. I had a quick look at Argot, and if 
I understand correctly, it is generating data and javascript code to enhance 
the search. So, I think it is possible integrate both tools nicely.

> Last thing, unrelated: from the search box one can see you have many
> modules extending the stdlib (the Ocp* modules). Why another stdlib
> extension instead of, say, contributing to batteries ?

That's true, we have developed internally some limited extensions to the 
standard library; that's because we didn't want to have external dependencies 
for our tools and because the amount of extensions was very small (so it was 
quicker to write the extensions than to modify an external library) However, 
we don't plan to release yet-an-other-standard-library, so I guess than we 
could later participate and switch to more widely-used standard library 
Daniel Bünzli asked and Xavier Clerc replied:
> Regarding search by type, I wonder if people actually use this for
> useful reasons or if it's just out of curiosity or for the cool hack
> factor -- and sure it's cool. I mean there's not enough semantics in
> types to tell you what a function will do, and since we curry it is
> not always clear in which order we will argument.

To be clear, I implemented search by type in order to understand a bit
more the book of Roberto Di Cosmo about type isomorphisms. Whether it
can be a useful tool remains to be determined. The tool now exists,
let's see if there is a usage for it.

I do agree that there is often not enough semantics in OCaml types, but
please notice that the order of arguments and whether the function is
currified is not relevant. Indeed, doing type search up to isomorphisms
allows to get rid of these details, all of the following queries will
answer with "String.sub":
  - "int -> int -> string -> string"
  - "string -> (int * int) -> string"
  - "string * int *int -> string"
while the actual signature is "string -> int -> int -> string".
rixed asked and Fabrice Le Fessant replied:
> Last thing, unrelated: from the search box one can see you have many
> modules extending the stdlib (the Ocp* modules). Why another stdlib
> extension instead of, say, contributing to batteries ?

First, we don't have so many of them, we only put there what we needed
for our set of tools. Some of them are really close to the compiler, and
we might submit them for inclusion in the official distribution, so we
didn't want to add a dependency to Batteries or Core too early.

The other reason is that we haven't tried Batteries or Core enough yet,
we have constraints, and we must make sure that if we rely on the some
library, the library fit these constraints. For example, I know that
Core has not been tested on Windows, and I don't know for Batteries.
Also, we want to separate between "lang" and "system", i.e. modules that
can be implemented with the core language, and modules that have system

Finally, unlike other companies using OCaml, we want to provide support
on the language itself, which means the compilers, other dev tools, and
also basic libraries. So, at some point, we will have to contribute to
either Core or Batteries, or both, but before that, we need to think
more about our own idea of what a good standard library should be, to
choose the best candidate from our point of view.
Gerd Stolpmann also replied to the original announcement:
Excellent! I'll definitely use it.

Another idea for a feature: more options how classes and modules are
shown. For example, I once had the problem that I wanted an included
module also to be included in-place in the documentation (rather than by
reference/link). I modified the ocamldoc generator to get this effect,
and the result is here:

The grey box contains actually the included definitions. This is much
easier to understand for the casual reader. The feature is accompanied
by a link rewriter, so the ocamldoc-generated links point to the
including module rather the included module.

A similar problem occurs for inherited class types. Of course, one wants
to enable this on a case-by-case basis.

I blogged about this some years ago:

The generator (very specific to this case):

Jump-to-definition and type-aware completion for Caml


Daniel Bünzli asked and Gabriel Scherer replied:
> But having been recently forced out of emacs into a proprietary IDE to
> be *able* to work on a project written in a
> programmingLanguageWithAbsurdlyLongNamingConventions, one thing I
> actually became very fond of is type aware autocompletion and the
> ability to browse from a symbol in my code directly to the page where
> its documented. The former may be complex to implement without
> compiler support but I'm sure the latter is not. My elisp skills are
> however too limited for me to implement that myself but I'd love to
> have that in ocaml's emacs mode.

There are various external projects/patches to do this kind of things:
- Jun Furuse's [Ocamlspotter] is a patch to the compiler to enrich
.annot files with where-defined information on symbols. It has some
emacs integration code.
- Peng Zang's Enhtop+ (an incremental update of Zeng Li's Enhtop
enhanced toplevel) provides enviroment lookup capacities in the
toplevel. He uses it to build [tuareg-plus], an emacs glue providing
context-aware completion (I'm not sure how good it works though, never
tried myself)


Beware that all those projects tend to be built as patches to the
ocaml distribution, which means difficult deployment (which means few
users, which means few maintenance, which means bitrot). I'm not
saying life is *easy* if you wish to use IDE tools for OCaml, only
that it is possible.

There are surely other alternatives I forgot about (please feel free
to add something) and related projects that are interesting as well
(eg. Jérémie Dimino 'utop' toplevel). You may also have a look at the
various attempts at integrating OCaml with Java IDEs (Oca'IDE, Ocaml
Development Tools, etc.). I'm various people are also developing new
exciting tools. For example, Ocamlpro has announced that it
could/would develop IDE tooling, for example; incidentally, they also
work on internal passes dumping techniques that might make development
and deployment of such tools easier in the future.

Is it possible to extend OCaml lexer rules via Camlp4?


Jun Furuse asked and Nicolas Pouillard replied:
> I want to have pcre regexp literals in the same syntax as Perl i.e.
> /hello\sworld\\n/. Currently what we do in OCaml is Pcre.regexp
> "hello\\sworld\\\\n", where the backslash char must be escaped in a
> OCaml string literal. This is lousy for scripting in OCaml.
> To have the same or similar syntax as Perl, the lexer must be really
> modified. Currently I am using a modified CamlP4 where I can replace
> its lexer function, but it is an adhoc way, and I am seeking any
> healthier way without such a modification.

 As said earlier Camlp4's lexer is not extensible. One can change
the meaning of the token stream using the token filters but this
won't work in your case. The third option is to use quotations this
is really the adapted feature for this task. Of course the syntax
won't be as concise as /bla/...

Regarding OCaml lexing you may be interested in camllexer [1] which
is not intended to be extensible but is very small and selfcontained.
If you really want to hack your own lexical syntax I suggest you to fork
camllexer and change it for your purpose.

Jérémie Dimino also suggested:
Have you look at camlp4 quotations ? Basically you can define a new
quotation named "foo" and in you code you can write:


The ... can be any string, except that it cannot contains >>.

Also you may be interested in the Mikmatch syntax extension:
Jun Furuse then concluded:
Unfortunately the conclusion seems to be currently there is no way to
change the lexer by pa_*.cmo modules.

Then, I stick to my patched p4 approach for now. With it I can use
$/regexp\n/i and $`find . -iname hoo` syntax, but for whom using the
vanilla p4, they can still use <:m<regexp\n/i>> and <:qx<find . -iname
hoo>> :

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


Argot 1.0:

Plasma 0.5:

After NoSQL there will be NoServer:

Argot: 1.0:

OCaml, the ultimate refactoring tool:

Disk space problem solved:

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