Previous week Up Next week


Here is the latest OCaml Weekly News, for the week of January 21 to 28, 2014.

  1. Releases of xtmpl, ocaml-rdf, stog, stog-rdf, stog-writing and genet
  2. Announcing yet another Makefile for OCaml
  3. Other OCaml News

Releases of xtmpl, ocaml-rdf, stog, stog-rdf, stog-writing and genet


Maxence Guesdon announced:
It is my pleasure to announce new releases of various tools and
libraries of mine. The opam packages are already submitted and will be
available soon.

# Xtmpl 0.8 []

Xtmpl is a small XML templating library for OCaml.
This release changes the API to allow fold-like style rewriting.

# OCaml-RDF 0.8.0 []

OCaml-RDF is an OCaml library to manipulate RDF graphs and execute
Sparql queries. This release fix a small bug and adds convenient

# Stog 0.10.0 []

Stog is a static web site compiler. It is able to handle blog posts as
well are regular pages.
This release contains a lot of changes, listed here:

# Stog-rdf 0.10.0 []

This Stog plugin allows to easily specify RDF triples within elements,
to produce a RDF graph for the whole generated site. It also permits
executing Sparql queries to include data in the generated pages. 
This release follows Stog's new architecture.

# Stog-writing 0.10.0 []

This plugin adds new rewrite rules to use foonotes and bibliographies
in generated pages, with also auto generation of paragraph ids. 
This release follows Stog's new architecture, and include some minor

# Genet 0.6 []

Genet is tool to build a continuous integration platform. It is
particulary adapted to developments involving various tools working in
chain, that is some tools producing files used by other tools and so
on. This release follows the new API of Xtmpl 0.8.

Announcing yet another Makefile for OCaml


Christian Rinderknecht announced:
I would like to announce a Makefile for small OCaml projects.

Although this list is read by many seasoned programmers who likely use
ocamlbuild, those who prefer total control over the build process and
beginners alike may find it useful. It is distributed along with a
manual and a detailed documentation in ASCII. The requirements, beyond
the obvious, are GNU Make 3.82 or 4.00 (later recommended for
paralellism), GNU Sed, Linux (with GNU coreutils) or Darwin (OS X) and
dash or bash.

Particular emphasis has been brought to reporting only independent
errors and minimising recompilations. The makefile has no interface
with control version systems, but it detects modifications, deletions
and creations of source files between build cycles, and it reacts
appropriately so there is no need to restart a build cycle from a
clean slate to correct an inconsistency. Note that, as usual with
makefiles, this build system relies only on time stamps to determine
its actions.

Since this is a beta release, you are very welcome to report any
errors. Let me also know if you improve portability (e.g., the sed
regular expressions are mostly compatible with BSD sed, but not

The urls are
William R then asked and Christian Rinderknecht replied:
> could you explain differences with OCamlMakefile

This is a fair question, since Markus' work has been around for quite
a while, but I am afraid that I never used it. Nevertheless, I went
through the documentation and the source code and here are the main
differences I can see at the moment (my apologies to Markus if I am

OCamlMakefile vs my Makefile
* User specifies SOURCES and RESULT vs optional OBJ and BIN
* Order of linking must be specified vs optional
* Builds library and toplevels vs none
* Supports -pack/-for-pack and profiling vs none
* Preprocessors in special comments, no command-line options per
source file vs one tag file per source file + global options
* Generates documentation vs none
* Subprojects vs mono-project
* Support for ocamlfind vs none
* Included in another Makefile vs includes another Makefile
* One native code compilation vs two
* 1300 lines vs 830 lines
* Plethora of phony targets vs two
* Short documentation vs long

OCamlMakefile supports more features than I do, although I use tag
files à la ocamlbuild. This is not surprising, as my makefile was not
developed to cover many use-cases, just mine and those of
beginners. Accordingly, I put an extreme emphasis on different issues,
like having the laziest makefile possible: it works a lot in order to
compile as little as possible and requires the programmer to configure
as little as possible. The output on the terminal is entirely
generated by the Makefile, not by the tools it calls, and, if
available, it leverages the --output-sync option of GNU Make 4.0 to
keep everything readable while using parallelism. Also, there is an
impact analysis in case of errors, so there are no redundant error
messages (one error implying another in another module) and no useless
recompilations (bound to fail). Another feature is that my makefile
keeps track of source deletions, which are a major source of
inconsistencies, while updating compilation dependencies locally, and,
generally speaking, the main design principle is that you should
*never* have to do [make clean] if you don't really want to (the only
case where you should is compiling to native code when maximising
cross-module optimisations and inlining).

> why not contribute to this project if you introduced compatible
> clever ideas ?

OCamlMakefile and my Makefile address different crowds, but these can
actually benefit from each other, you are right. I will keep that in
mind, but before I add more features à la OCamlMakefile, or the other
way around, I would like to have bug reports.

You can simply try my makefile by putting it in a single-directory
project and setting BIN to the main module's basename in
Makefile.cfg. (Each file requiring camlp4 or special options for
certain tools require a tag file. See
John Whitington then replied:
To correct a few: in OCamlmakefile:

> * Builds library and toplevels vs none

make top, make byte-code-no-link, make native-code-nolink

> * Generates documentation vs none

make htdoc/ltdoc/psdoc/pdfdoc

> * Support for ocamlfind vs none

PACKS = camlpdf

to use ocamlfind packages.

To get it to use ocamlfind all over, use


(not documented)
Goswin von Brederlow said and Christian Rinderknecht replied:
> No ocamlfind? That realy sucks. Anything non trivial will require
> some extras, if only batteries, core or unix. You realy need support
> for ocamlfind so adding libraries becomes easy.

If you want to use ocamlfind as a driver to ocamldep, the compilers
ocamlc and ocamlopt and the linkers, you can simply prefix the calls
to these in the Makefile like so:

instead of ${OCAMLC} ....
write ocamlfind ${OCAMLC} ...

Then use the tag files for .mli, .ml and for the two linkers
(byte-code and native-code), to pass options specific to ocamlfind as
if they were for ocamlc, ocamlopt etc.

Adding libraries and performing queries should be done outside the
Christian Rinderknecht then added:
I committed the very simple fix I suggested to you in my last
email. Now you can simply set

OCAMLFIND := ocamlfind

in Makefile.cfg and you use the tag files as usual, except the command
lines will be passed to ocamlfind. For example, a tag file may be

ocamldep: -syntax camlp4o
ocamlc: -syntax camlp4o

(Note: the warnings emitted by [ocamlfind ocamldep ...] are printed
the first time and lost.)

The urls are
Malcolm Matalka also replied to the original post:
FWIW, I have my own Makefile approach, with ocamlfind support.  I
started it because I wanted to understand how to compile things in Ocaml
and the various files needed to build different variables.  Since then
it's grown into the base for all of my Ocaml.

I should probably use ocamlbuild but I've never really found it that
compelling and my Makefile solution handles making and running tests and
examples for me just how I like it.

It is in a repo I clone from whenever I start a new repo:

I don't actually suggest using it unless one understands Makefile's a
bit, it's made specifically for things I want.

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

Pattern synonyms, arbitrary patterns as expressions:

Batteries 2.2 released:

Full Time: Software Developer (Functional Programming) at Jane Street in New York, NY; London, UK; Hong Kong:

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