Previous week Up Next week


Here is the latest Caml Weekly News, for the week of 31 August to 07 September, 2004.

  1. Cygwin now has ocaml 3.08.1
  2. GODI news: GODI switches to O'Caml 3.08.1
  3. ocamlyacc tutorial (version 0.1)
  4. ocamllex, ocamlyacc tutorial
  5. ML Seattle meets Thursday, Sept. 9th
  6. automatic documentation of ocamlyacc grammars
  7. camlclipse 0.1.0 - OCaml support in Eclipse
  8. The demexp project is looking for OCaml developers
  9. JavaLib 1.0 Released
  10. cocanwiki 0.9.5 released
  11. Ocaml automation update
  12. Announcing the OMake build system version 0.9.1
  13. OCaml Network Application Environment (OCaml NAE)

Cygwin now has ocaml 3.08.1


Blair Zajac announced and quoted Igor Pechtchanski:
Good news.  Yet another way of getting Ocaml on your Windows system.

Date: Tue, 31 Aug 2004 12:46:11 -0400 (EDT)
Reply-To: The Cygwin Mailing List <>
From: Igor Pechtchanski <>
Subject: New package: ocaml-3.08.1-1

The ocaml package has been added to the Cygwin distribution.

Objective Caml is a fast modern type-inferring functional
programming language descended from the ML (Meta Language)
family, containing objects, modules, and a high-performance
native-code compiler.  The O'Caml compiler was developed at
INRIA Rocquencourt, projet Cristal.

See for more information.


- This package includes two compilers: the bytecode compiler and the
  native compiler.  Each compiler also exists in two versions -- bytecode
  and native (i.e., each compiler was built with the bytecode compiler and
  the native compiler, in turn).

- This package also includes all the libraries and packages in
  /usr/lib/ocaml, including "labltk".  You will need to install the tcltk
  package and possibly the X11 packages to use labltk.  The "labltk"
  package wasn't tested on Cygwin, so use at your own risk.

- There may have been a temporary glitch in uploading the packages.  This
  has been fixed on the master site, but some mirrors may have pulled the
  corrupted version of the package in the meantime.  If you're unlucky
  enough to have selected such a mirror, try another mirror.  FWIW,
  mirrors updated at any point after August 31, 14:08 GMT should be fine
  (look at the timestamp on setup.bz2).

To update your installation, click on the "Install Cygwin now" link on the web page.  This downloads setup.exe to your system.
Once you've downloaded setup.exe, run it and select "Interpreters" or
"Devel" and then click on the appropriate field until the above announced
version number appears if it is not displayed already.

If you have questions or comments, please send them to the Cygwin mailing
list at:  <cygwin at cygwin dot com>.  I would appreciate it if you would
use this mailing list rather than emailing me directly.  This includes
ideas and comments about the setup utility or Cygwin in general.

If you want to make a point or ask a question, the Cygwin mailing list is
the appropriate place.

Igor Pechtchanski
Cygwin O'Caml Maintainer
Christophe Raffalli asked and Martin Boeker answered:
>Is it a pure cygwin or cygwin_mingw build of ocaml ?

This is a pure Cygwin port. The package works fine - I tested it.

Oddly, the paths of the bin and lib branches (the --prefix configure
option) are not set the Cygwin standard way so that they land in
/usr/bin and /usr/lib (ususally /usr/local ...).

It's a pure Ocaml distribution (3.08.1); all other needed packages have
to be build separately - for my part (working a lot under Cygwin) the
GODI (G. Stolpmann) distribution is a better solution.

Perhaps, this Ocaml Cygwin distribution could be enhanced by adding
further packages to a common library package (could be: equeue, expat,
extlib, findlib, getopt, netclient, dbm, graphic, ocamlmakefile,
ocamlnet, pxp, wlex, ulex, xstr, oreilly ocaml book), further an
experimental lablgtk2 package. Also the mysql and postgres bindings
would be nice (that seems to be tricky).

This would promote the use of Ocaml in the Win-World. The Cygwin
distribution has developed very positively in the last months and is
very useful for people forced to work under Win.

GODI news: GODI switches to O'Caml 3.08.1


Gerd Stolpmann announced:
GODI, the O'Caml source-based distribution, has just switched to O'Caml
3.08.1 (as replacement for O'Caml 3.08.0). Read more below.

GODI is a system that automatically downloads, builds, and installs the
core O'Caml system together with a growing number of libraries and other
add-on software. It runs on Linux, Solaris, FreeBSD, NetBSD, Cygwin,

If you are new to GODI, read more here:

Details of the switch to O'Caml 3.08.1:

If you have already installed GODI for O'Caml 3.08, you can (and should)
upgrade to O'Caml 3.08.1 by starting godi_console, and by selecting the
menu point "Update the list of available packages". This downloads the
newest build information. Then, go to "Select source packages", press
"u" followed by "o" to upgrade everything, and type "s" to start the
build. This recompiles almost all packages.

If you bootstrap GODI, the new release will be selected automatically.
(The old bootstrap tarball still works.)

GODI no longer supports O'Caml 3.08.0; the old 3.07 version is still
available, though.

Please note that the setting GODI_SECTION=3.08 is still valid although
it selects now O'Caml 3.08.1.

Gerd and the GODI team

ocamlyacc tutorial (version 0.1)


SooHyoung Oh announced:
I completed the ocamlyacc tutorial version 0.1.
Please check .
and report bug or wrong statements.
Actually, I borrowed almost all of the text from "bison" manual
and fixed it for "ocamlyacc".

Bug fix version will be followed in a few days.

As you know, the companion tutorial for ocamllex is available at .


This is a tutorial on how to use ocamlyacc on which is distributed with
Ocaml language.

This tutorial borrowed lots of part from bison manual and some part from
Chap. 12 Lexer and parser generators (ocamllex, ocamlyacc).

The companion tutorial for ocamllex is available at .

Please mail all comments and suggestions to <shoh at compiler dot kaist dot
ac dot kr>

This tutorial is work-in-progress. The latest version can be found at .

You can find the source of this document in ocamlyacc_tutorial_src.tar.gz,
and for printing, pdf (A4 size) is presented.

Last updated: 2004-09-01

ocamllex, ocamlyacc tutorial


SooHyoung Oh said:
I closed web pages of ocamllex, ocamlyacc tutorial for the time being. I'll
reopen as soon as possible after resolving the license problem.

And now, I'd like to know whether some of the text from ocaml manual can be
included in these manuals or not.

Who should I contact for this problem?

ML Seattle meets Thursday, Sept. 9th


Brandon J. Van Every said:
ML Seattle is for people interested in face-to-face discussion of the ML
family of programming languages, including Standard ML, OCaml, and
others. Meetings are held every 3 weeks at The Stumbling Monk, a pub in
Capitol Hill with exceedingly good Belgian beer.  We have a mailing

We will meet Thursday, September 9th, at 7:00 pm at

The Stumbling Monk
1 6 3 5   E. Olive Way
at corner of Olive and Belmont
kitty corner from the B&O Restaur*nt

Beware that the advertizement as seen from the street is extremely low
key.  The sign in the window is hardly noticeable and the awning above
the front door still says "TYPING" on it.  Due to the popularity of
the rotating specialty brews offered, the owner really has no need for
additional salesmanship. I imagine if you ask the locals, they can
point you at it.  Especially local shopkeepers.

Things to know about The Monk:

- it serves yummy Belgian beers!
- the bier menu rotates constantly
- specialty 'aged' beers are available
- it is non-smoking
- it isn't very big
- it's low-lit
- they have chips, feel free to order a pizza from elsewhere
- parking is typical Capitol Hill parking, i.e. bad

automatic documentation of ocamlyacc grammars


Shaddin asked and Hendrik Tews answered:
> Does anybody know of a tool that, given a .mly file, parses the file
> and produces documentation of the BNF of the grammar in latex (or
> html, or anything...). This would be very useful for those of us who

I just saw your question now.

I use a self written emacs lisp script. From this input
I produce a raw grammar
and a user friendly version
The latter exists also as txt file

For the user friendly version I apply some transformation that
introduce [ ] and { } for optional occurence and repetition. For
these transformations I also have emacs lisp functions. However,
they are not very robust: Whenever I change the grammar I have to
adopt the script for the user friendly version.

You can download all scripts from the CCSL repository:
To see what you need and how it is working look for the
grammar.html and compiler.html goals in Doc/GNUmakefile.

camlclipse 0.1.0 - OCaml support in Eclipse


Andrei Formiga announced:
  In the spirit of "release early, release often", we therefore
announce the first release of camlclipse (version 0.1.0), a group of
plugins to add OCaml support in the Eclipse IDE. It provides very
basic support for creating OCaml projects, editing source files,
building and running. Features include:

  - incremental building
  - ocamlc integration (no ocamlopt yet)
  - automatic dependency calculations (via ocamldep)
  - basic syntax highlighting for comments, keywords and string literals
  - running of produced executable inside the IDE, with output
captured in the Console view

   Please note that it is still in early alpha, and not intended for
production use yet.

  The home page for the plugins is

  You can download and install the OCaml support using Eclipse's
Update Manager. The update site is

The demexp project is looking for OCaml developers


David Mentre said:
This is a call for developers.

In short

The demexp project is a free software project (GNU GPL) that aims at
making the software needed to start the democratic experience
project. The democratic experience is a large scale project of direct
democracy. It aims at providing the tools to facilitate the expression
of all citizens, to transform this expression into decisions, and to
apply this decision.

After one year of development, we feel the need of help to reach as soon
as possible a working prototype. So we are looking for OCaml developers
that would be interested in helping us. Beyond its political objectives,
this project is interesting from a computer science point of view
because it touches a wide range of subjects, from networking to user
interfaces, through cryptography, databases, graphs, logical search
systems, etc.

Of course, demexp is written in OCaml.


More on the democratic experience project

The democratic experience is a large scale project of direct democracy.
It aims at providing the tools to facilitate the expression of all
citizens, to transform this expression into decisions, and to apply this

In the democratic experience, each participant can submit a question,
propose answers, and vote. All winning answers to the votes are gathered
into a database that represents the common position of the group. This
common position can be used to drive decisions.

Thus, the democratic experience is a complete and open tool for direct
democracy. It can apply to small groups of people (associations,
companies) but also to larger groups (countries, the planet!).

For more information:

Technical description of the demexp software

The demexp software is a kind of client-server voting software. The
server stores a database of questions and their associated responses and
the clients are allowed to vote on those responses. The communication
between client and server is made using RPC (thanks to Gerd Stolpmann's
RPC package). The server implements a Condorcet voting procedure to
resolve votes into taken positions.

Demexp is however different of most voting software, because it fulfils
the requirements of the democratic experience project. For example,
clients are allowed to change their vote at anytime. People can also
delegates their vote to another participant.

We want to make a good software so we try to adhere to good software
engineering practices. For example, the code is developed in literate
programming style using Norman Ramsey's noweb tool. Each module has
non-regression tests.

The versionning tool used is GNU Arch. The main demexp repository is at:

The latest source tarball is available at:

You'll find a example of the server source code in literate style at:

The technical website for development is on Savannah:

 (WARNING: the CVS repository on Savannah is NOT up-to-date)

The demexp software is licensed under GNU GPL.

What is the current state of demexp?

Demexp is not vaporware. We have started about one year ago the
development of the demexp project. However, due to low manpower and the
complexity of the software, we have not yet reached a demonstration
prototype. At first, we wanted to have a working prototype before
calling other people but it appears the task is harder than we expected.

Right now, we have implemented on the server:

 - repository of questions, responses and participants (as OCaml data

 - condorcet voting;

 - classification of questions;

 - networking.

On the client side, we have just a set of windows and dialogs in Glade
format that compiles into lablgtk2 code.

Both are working on Linux.

We would like to reach the following objectives:

 * v0.4: basic client and server; saving of server bases in XML format;

 * v0.6: handling of delegation, internationalization (of both software
         and the questions themselves), port to various architectures
         (Windows, Mac OS X, other Unix);

 * v0.8: proper handling of security issues, mainly related to vote
         peculiarities (very hard task!! we're looking for experts)

 * v1.0: scalability issues, use of real databases, integration of
         logical search system into the client, etc.

There is a lot of interesting issues for the future: replication of
bases, information forum, integration of demexp in other softwares,
formal proving of algorithms and protocols, ...

We are looking for OCaml developers in all areas but we are especially
interested by people wanting to develop LablGTK2 software interface.

How can I contribute?

Just join the demexp-dev mailing list and let us know in what part you
are interested:

If you have further questions, do not hesitate to ask me.

We hope to have your help. We have a lot of interesting issues for you. ;)

Have a nice day,
david -- on behalf of the democratic experience project

JavaLib 1.0 Released


Nicolas Cannasse announced:
JavaLib 1.0 has been released and is available here :
JavaLib is a library that can fully parse Java .class file into OCaml data
structure, thus enabling the OCaml programmer to extract informations from
class files, to manipulate and to generate valid class files. I was
projecting to write a small JVM in OCaml in order to run the parsed opcodes
but since I don't have the time to do this, I'll leave that to anybody
interested : the source code is GPL.

cocanwiki 0.9.5 released


Richard Jones announced:
COCANWIKI, the Wiki written in Objective CAML, releases version
0.9.5.  New in this version:

 * Edit conflicts detected and shown.
 * Page layouts can be changed with stylesheets
   (see examples of this:
 * File and image upload completed.
 * Wiki administration section.
 * Some anti-spam changes.
 * Page redirects.
 * Many bug fixes.

More about the features:

Download from here:

Ocaml automation update


Alex Baretta announced:
I wish to let you know that the first application of ocaml to realtime
industrial control has succeeded. The machine has passed all integration
tests at the customers site and is already operating at its full potential.

Baretta DE&IT is currently developing a hard realtime CNC architecture
based on Ocaml for motion control and CAM applications, aiming at
submillisecond sampling periods.

The full code is released to the customer under the GPL, although we
still have not put up a web site to foster the development of logical
and numerical control Ocaml applications based on our free kernel
library. Hopefully we will have time to put up such a web site soon.

Announcing the OMake build system version 0.9.1


Jason Hickey announced:
OMake is a build system, similar to GNU make, but with many additional
features.  The home site for OMake is

   o Support for large projects spanning several directories or
     directory hierarchies.

   o Builtin support for OCaml and C projects, or a mixture thereof.

   o Fast, accurate, automated dependency analysis using MD5 digests.

   o Portability: omake provides a consistent interface on Win32 and
     on Unix systems including Linux, OSX, and Cygwin.

   o Builtin functions that provide the most common features of programs
     like grep, sed, and awk.  These are especially useful on Win32.

   o Active filesystem monitoring, where the build automatically
     restarts whenever you modify a source file.  This can be
     very useful during the edit/compile cycle.

   o A companion command interpreter, osh, that can be used

In the MetaPRL ( and Mojave
( projects we develop and maintain several
moderately large systems consisting of a mixture of OCaml, C, and
theorem proving code.  We developed OMake out of the need for a build
system that was simple, flexible, and reliable, especially for large

OMake preserves the syntax and rule definitions used in Makefiles,
making it easy to port your project to omake.  There is no need to
code in perl (cons), or Python (scons).  However, there are a few
things to keep in mind:

   1. Indentation is significant, but tabs are not required.
   2. The omake language is functional: functions are first-class
      and there are no side-effects apart from I/O.
   3. Scoping is dynamic.

To try it out, run the command "omake --install" in a project directory,
and edit the generated OMakefile.  Often, an OMakefile is as simple as a
single line

    OCamlProgram(prog, foo bar baz)

which states that the program "prog" is built from the files,, and  You may want to choose which compiler is
used (by default, omake builds native code).  You can use the
BYTE_ENABLED and NATIVE_ENABLED flags to control this.

    NATIVE_ENABLED = false
    BYTE_ENABLED = true
    OCamlProgram(prog, foo bar baz)

If you have C files (say file1.c file2.c file3.c) in your project, you
can add them using the StaticCLibrary function.

    StaticCLibrary(libx, file1 file2 file3)
    OCAML_CLIBS = libx
    OCamlProgram(prog, foo bar baz)

If you have other directories in your project, you can include them with
the directive

    .SUBDIRS: dir...

For further information see the documentation at, especially the section on examples.

OMake 0.9.1 is an alpha release.  While we have made an effort to ensure
that it is bug-free, it is possible some functions may not behave as you
would expect.  Please report any comments and/or bugs to the mailing
This spawned a huge thread, here are some hilights. Yaron Minsky said:
I've been using omake for a while now and it has worked very well for
us.  One nice feature of omake as opposed to ordinary make (not sure
how this compare to scons and other competitors) is that omake takes a
broader view of dependencies, including the rules themselves in the
calculation.  So, for example, when you modify a build command,
everything that was built with that build command is recompiled.
Chris Danx said and Matthieu Dubuget answered:
Chris Danx wrote:
>Nicolas Cannasse wrote:

>>However, I can't help thinking that I don't write to learn yet another
>>language for writing my Makefiles... Why not using directly OCaml for
>>writing Makefiles and exposing all nice OMake features through a
>>library ?
>One question that springs to mind is why hasn't anyone made a tool that
>does the build process based on the semantics of Ocaml?  Or have they?

May be YaM is a first step toward this. YaM was written by Damien Pous:

I tried it some time ago and found it very interesting, but need to be
improved (support of different platforms, more targets, etc.). I began
to study it and had not the time to continue.
Nicolas Cannasse also answered Chris Danx:
> One question that springs to mind is why hasn't anyone made a tool that
> does the build process based on the semantics of Ocaml?  Or have they?
> I used to (and sometimes still do) program in Ada using Gnat and most of
> the compilation can be handled by tools like gnatmake which handles all
> the dependancies.  The Ada language has some specific rules on
> compilation and recompilation.  Perhaps this is the difference?

Well I think OCamake is doing this :
and it works well on all platforms running OCaml.
Marcin Kowalczyk asked and Christian Lindig said:
>It would be interesting to invent some alternative paradigm, but I've
>never seen one.

Here are the paradigms for build systems that I know:

        Make - uses rules to specify the dependency tree, walks the
        dependency tree, analyzes the file system, and builds files concurrently
(hence, no planning in advance)

        Vesta - specifies the build procedure in a functional language and
evaluates the procedure for building. No concept of updating like in
Make - all builds are complete in concept; efficiency comes from
caching intermediate results and hence the evaluator knows that it does
not have to rebuild everything. The Vesta system observes dependencies
by observing the tools that are run during the build process: which
files are read and written. Very powerful but is more an environment
than a tool.

        Jam - like Make, but has procedural abstraction: a program is
evaluated to build up the dependency tree. Unlike Make, clean
separation of phases: analyzes the file system, makes a plan, and
executes it. Hence, no checking the file system while executing the
plan. Similar tools: Cons, SCons.

You can find papers here:
Nicolas Cannasse said and Aleksey Nogin answered:
>Other way to ask the question : what features make the OMake language better
>than OCaml for writing Makefiles ? Or is it just syntactic sugar ?

It's not about language, it's about the features that the build system
provides. Here is a list of features of omake that I think would be hard
or impossible to reproduce in a "Makefile generator":

- Omake knows that a single build command can produce more that one
file! (Think omcamlopt producing both .cmx and .o, or ocamlc on an
..mli-free .ml producing both .cmo and .cmi). This really simplifies life
as you do not have to hack around your build system not knowing the
side-effects of commands you invoke. See also the "Quick example" below.

- Persistent filesystem monitoring (based on FAM) mode - in this mode,
as soon as one of the source files is changed, the build is process is
restarted accordingly (whether omake was idle or already building
something in the project). In my experience this significantly speeds up
the process of fixing typos, type checking errors, etc.

- As already mentioned by Yaron, the commands for building a file are
themselves included in the dependency for the file.

- Complete timestamp/MD5sum testing for file modifications. Note that
once you make the dependency information truly complete (which is the
goal of omake), then this becomes a must. Often not all changes in a
dependencies result in the generated file being actually changed. When a
file stays the same after it is rebuilt, you want to detect this to
avoid rebuilding too much.

- Being able to specify "dependencies of dependencies". In other words,
not only you can specify how to scan a file for dependencies (e.g.
ocamldep, "gcc -MM", etc), but you can also specify what the scanning
process itself depends on. For example, if you have a custom
ocamldep-like program, then you can specify that it needs to be built
before scanning dependencies of certain files and that whenever that
binary changes, the dependencies of those files need to be recomputed.

- A global view of the whole project (not just per-directory). This not
only helps in making sure that the dependency graph is as complete as
possible, but also gives the parallelizer (omake supports the same -j
option as make) more freedom. Of course, in a "Makefile generator" you
could try to generate one huge Makefile for a project, but even with
such a file if you ever end up calling make recursively, it will no
longer have a complete view of the whole project.

- Quick example: suppose that you have a file "" (with no foo.mli)
and a file "" that refers to "Foo" and supposed that you are
compiling bytecode. The standard ocamldep would generate

foo.cmo: bar.cmo

dependency. Which means that whenever changes, foo.cmo (and
everything that depends on it) will get rebuilt.

In omake's case, our version of ocamldep will generate the "proper"

foo.cmo: bar.cmi

Then, omake's rule for building .cmi specifies that in the absence of an
..mli file (and when no rule for building such an .mli is present), use
"ocamlc" for building the .cmi. Next, omake will check whether .cmi
have changed (compared to what it was the last time omake compiled it,
not compared to what it was right before!) and if not (imagine that
you've change the code in .ml without affecting the signature - bar.cmo
would change, but bar.cmi would not), then foo.cmo will not get rebuilt.
Olivier Grisel asked and Aleksey Nogin answered:
>OMake looks really interesting according to your description. Do you
>plan to provide a GODI package ?

We will probably try providing it if somebody requests it. Currently we
provide Red Hat RPM packages (source and binaries for various releases
of Red Hat Linux and Fedora Core) as well as zip files with sources and
Windows binaries. See
Aleksey Nogin then announced:
Well, I have created a godi package for omake that seems to work for me
(any feedback would be appreciated as I have no previous experience with

Now, how do I go about getting it included in the GODI repository? Thank

OCaml Network Application Environment (OCaml NAE)


James Woodyatt announced:
The OCaml Network Application Environment is a project to provide a
modular framework of libraries in Objective Caml to support the
development of concurrent, single-thread-reactive network application
servers with a functional programming style.

        The project page on SourceForge is here

Its centerpiece will be a general-purpose implementation of the Blocks
Extensible Exchange Protocol (BEEP) Core, and other application
protocols may follow.  It is a work in progress, and most of the code
is not yet ready for production use, but a preview release is on the
near horizon.  (NOTE: This is *not* a solicitation for assistance.)

Previously on the Caml List, I have made announcements about a personal
project I called "Pagoda".  I have also mentioned that my earlier Iox
project has been abandoned and that I am working on a new project with
the same purpose in mind.  The OCaml NAE is that project; it has been
renamed to be more descriptive, and to resolve a conflict with another
project on the SourceForge.Net project hosting service.

The only package currently released in this project is the Core
Foundation (Cf) library, which is identical to the currently released
Cf library that is listed under my name on the Caml Humps.  I would be
grateful if the Humps could be updated to reflect the migration of this
library into the SourceForge File Release System.  I would also be
grateful if the Projects page at the Beepcore web site could be amended
to list this project as Type: Peer.

Additionally, I have just uploaded a raft of source code into the CVS
repository for the OCaml NAE project.  All of this new code, including
the current snapshot of the BEEP core implementation, has not been
published until now and it remains almost entirely undocumented.  I
mention it because developers of network application servers interested
in my progress may wish to monitor this SourceForge project.

I plan to make another announcement soon to the Caml list and the BEEP
Builders list when the preview release is available.

Using folding to read the cwn in vim 6+

Here is a quick trick to help you read this CWN if you are viewing it using vim (version 6 or greater).

:set foldmethod=expr
:set foldexpr=getline(v:lnum)=~'^=\\{78}$'?'&lt;1':1

If you know of a better way, please let me know.

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