Previous week Up Next week


Here is the latest Caml Weekly News, for the week of February 20 to 27, 2007.

  1. Maze generator
  2. PG'OCaml (PostgreSQL syntax extension for OCaml) 0.7 released
  3. Xmlm
  4. Yaxpo

Maze generator


Jon Harrop announced:
Whilst revamping our website, I took the time to improve the maze generator: 

it is now 30% shorter and much faster, using an array instead of a functional 
map. It also uses continuation passing style instead of an explicit stack. 
But it no longer produces PostScript output. 

The program uses a simple depth first search. An interesting alternative 
algorithm involves keeping track of sets of connection cells and breaking 
walls to unify the sets until you have a spanning tree. That should be easy 
to code in OCaml but I think it will generate mazes that are much harder to 

PG'OCaml (PostgreSQL syntax extension for OCaml) 0.7 released


Richard Jones announced:
I'm pleased to announce the release of PG'OCaml 0.7.  PG'OCaml is a 
syntax extension to OCaml which allows you to issue PostgreSQL 
commands in a type-safe manner from within OCaml code. 
You can find out a bit more here: 

This code is released under the GNU LGPL + OCaml linking exception. 

Changes since 0.5: 

 * Comprehensive support for profiling statements and analysing 
   the results. 
 * Gabriel de Perthuis - fixes for OMakefile support. 
 * Don't crash if we get notice messages from the server. 
 * More types supported. 
 * pa_pgsql syntax can connect to multiple databases.



Daniel Bünzli announced:
Xmlm is an OCaml module providing sequential XML input/output and 
a persistent cursor. It aims at making non valid XML processing 
robust and painless. 
The sequential interface can be used to process documents without 
building an in-memory representation. It also lets the programmer 
translate its own data structures to an XML representation and 

The cursor allows to navigate and update a simple in-memory tree 
representation of XML documents. Updates performed by the cursor 
are persistent (non destructive). 

To facilitate direct integration into projects, Xmlm is made of a 
single module and distributed under a BSD license. 

Project home page : 

Your feedback is welcome, 



Why another XML parser ? 

Dissatisfaction about existing solutions either too complete and 
complex or too britlle and restrictive. Besides it seems all 
existing parsers force you to read the whole document in 
memory. Here are some points that motivated the design of Xmlm. 

1. Easy to integrate into projects without introducing external 
    dependencies. A single module provides everything including 
    documentation (ocamldoc) and the license. 

2. Well documented. Features and limitations of the parser are precisely 

3. Easy to use yet flexible api. 
   - Choice between sequential (SAX-like) or tree (DOM-like) processing. 
   - Construction/deconstruction of user data structures from/to xml   
   - Tree processing with persistent cursor (zipper). 
   - Simple white space handling options for character data. 
   - Character encodings are translated to UTF-8. 
     UTF-8 is the only encoding the programmer needs to handle. 
   - Character references and predefined entities are resolved. 
     Other entity references can be resolved via a user provided   
   - Early access to data to allow parse time data transformations. 
   - Parse time element pruning. 

4. Robust parsing. Does not assume an xml subset. 
   - Supports major encodings :  ASCII, UTF-8, UTF-16 (LE and BE),   
   - Parses qualified names (namespaces). 
   - Tail-recursive. 

5. Limitations. If you need one of these things use PXP. 
   - Comments, processing instructions and standalone declaration are 
     dropped by the parser (it is a feature). 
   - No DTD support (but it can be extracted and written as a raw   
   - No validity support.



Mike Lin announced:
Despite an apparent curse causing any server hosting it to experience 
catastrophic hardware failure, I have once again revived the web page for 
the Yaxpo XML parser: 

Unfortunately, this should not be construed to suggest that I have any 
intention of updating the package; it has worked sufficiently for my 
purposes for the last five years. Xml-Light or the recently announced Xmlm 
are probably easier to use, unless you need the weird reentrancy 
stuff enabled by the astounding fallacy of an XML parser written entirely in 

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}$'?'<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