Previous week Up Next week


Here is the latest Caml Weekly News, for the week of September 07 to 14, 2010.

  1. ocaml-expect v0.0.1: Expect-like framework
  2. patterns for 3.12.0
  3. camera-rescue v0.0.1: Recover JPEG files from a crashed SD/MMC/CF camera memory card
  4. Enhanced Ocaml Documentation 3.12
  5. atdgen
  6. Other Caml News

ocaml-expect v0.0.1: Expect-like framework


Sylvain Le Gall announced:
This is a simple implementation of `expect` to help building unitary testing
of interactive program.

It helps to receive question and send answers from an interactive process.
You can match the question using a regular expression (Str). You can also
use a timeout to ensure that the process answer in time.

See the [Expect manual]( for more information and


Get source code:
$ darcs get

Browse source code:;a=summary

[Generated by 'OASIS announce']

patterns for 3.12.0


Jake Donham announced:
If you are interested in using Jeremy Yallop's patterns extension on
OCaml 3.12.0, I have fixed it up here:

I haven't tried anything serious with it but the tests pass.

Also I added a little extension for "alist patterns": a pattern

  alist [ "foo", x; "bar", y ]

matches association lists containing keys "foo" and "bar".

camera-rescue v0.0.1: Recover JPEG files from a crashed SD/MMC/CF camera memory card


Sylvain Le Gall announced:
This program searches for JPEG files into a dump of a memory card (a RAW
file). Once found, each files is saved in a different JPEG file.

This tool scans for JPEG markers inside the RAW. When a SOI (Start of Image)
marker is found, the tool scan the content to find a consistent EOI (End of
Image) marker.

It doesn't need to have a valid filesystem so it can handle most of the
crashed memory card. It recovers the image data and EXIF information.


Get source code:
$ darcs get

Browse source code:;a=summary

[Generated by 'OASIS announce']
Gabriel Kerneis asked and Sylvain Le Gall replied:
> Out of curiosity, what is the difference with recoverjpeg (except the
> programming language)?

As another user points me to, there is also:

camera-rescue is probably not as good as these other tools. There are
plenty of tools like this one. But it makes a good example code ;-)

Enhanced Ocaml Documentation 3.12

Hendrik Tews announced:
I would like to announce

                 The Enhanced Ocaml Documentation 
                          Version 3.12
   available via

This version of the Ocaml manual enhances the original html
version in the following way:

- Changes (wrt version 3.10) are tagged with icons and color 

- an additional appendix contains just the grammar rules

[There is no version for 3.11, therefore the changes are marked
with respect to 3.10.]



Martin Jambon announced:
It is my pleasure to announce atdgen, a program for deriving OCaml serializers
and deserializers from type definitions.  The supported serialization formats
are JSON and a new binary format called biniou.

The main URL for atdgen is

Four distinct source packages were created:

- biniou:  a new binary format designed for full extensibility
- yojson:  a new library for the JSON format
- atd:  "Adjustable Type Definitions", a syntax for type definitions
- atdgen:  OCaml code generator

All four packages are distributed under the terms of a BSD license.
MyLife holds the copyright for atd and atdgen while I hold the copyright for
biniou and yojson.

Multiple ideas have motivated this work.  They are explained in the following

A standalone example using atdgen is given in the source distribution and is
accessible at:

Package details:

 Author:  Martin Jambon
 Version:  1.0.1
 Kind:  code generator
 Godi package: yes

Atdgen is a command-line program that takes as input type definitions in
the ATD syntax and produces OCaml code suitable for data serialization and
deserialization. Two data formats are currently supported, these are biniou
and JSON.

 Author:  Martin Jambon
 Version:  0.9.2
 Development status:  stable
 Kind:  library
 Godi package: yes

ATD stands for Adjustable Type Definitions.  It is a type definition
language designed to accommodate a variety of programming languages and data
formats by the means of target-specific annotations.  It supports sum
types, parametrized types and inheritance.  The library provides a parser
and other tools useful for manipulating ATD type definitions.  The
reference manual gives a complete description of the syntax.

 Author:  Martin Jambon
 Version:  0.9.1
 Development status:  stable
 Kind:  library
 Godi package: yes

Biniou is a binary data format designed for speed, safety, ease of use and
backward compatibility as protocols evolve.  Biniou is vastly equivalent to
JSON in terms of functionality but allows implementations about 4 times as
fast (see godi-yojson for comparison), with 25-35% space savings.  Biniou
data can be decoded into human-readable form without knowledge of type
definitions (except for field and variant names which are represented by
31-bit hashes).

 Author:  Martin Jambon
 Version:  0.8.1
 Development status:  stable
 Kind:  library
 Godi package: yes

Yojson is an optimized parsing and printing library for the JSON format.
It addresses a few shortcomings of json-wheel including 3x speed
improvement, polymorphic variants and optional syntax for tuples and

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

Analyzing logfiles (2):

Analyzing logfiles (1):

Literate programming: where we are and where we should aim at:

Liquidsoap 1.0 beta1 and 0.9.3 released!:

Reading Camlp4, part 11: syntax extensions:

Dirty fix for omlet vim extension:

Windows Service:

analyse numérique:

list unique:

Time regression testing:

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