Previous week Up Next week


Here is the latest Caml Weekly News, for the week of 07 to 14 June, 2005.

  1. QuickCheck for OCaml?
  2. WDialog-2.1 released
  3. Mini ray tracer
  4. First release of AlphaCaml
  5. OC-SOAP 0.3.0 - a proper SOAP interface for OCaml
  6. Yaxpo XML parser

QuickCheck for OCaml?


Christopher Campbell asked and padiolea answered:
> Are there any QuickCheck like tools for OCaml?  Searched on google, but
> nothing came up.  There are unit testing libraries like OUnit, but I
> haven't came across anything like QuickCheck yet.

I use this:

All you have to do is include this library and then put in your code
rules such as

let _ = assert
 ((Quickcheck.laws "rev" (fun xs -> reverse (reverse xs) = xs)
   (Quickcheck.lg Quickcheck.ig)) = None)

the lg and ig functions are generators (list and integer generators).

By the way it also include a unit framework, but
it is just
  let testunitframework b = assert b   :)
that you use by writing for instance

let _ = testunitframework ( (fun x -> x +1) [1;2;3;4] = [2;3;4;5])
Christian Lindig also answered:
There is some code derived from QuickCheck in my Quest tool which you 
could use as a starting point. Quest generates C code for testing C 
compilers and uses QuickCheck-like combinators to control the 
statistical distribution of the code generated. 

WDialog-2.1 released


Gerd Stolpmann announced:
I have just released WDialog-2.1, the toolkit for dialog-centric web
applications. This release adds several session managers written by
Eric Stokes, including a daemon-based session manager for almost
unlimited scalability. There are a number of language modifications, but
they are all backward-compatible. The serialization method has been
changed, instead of relying on O'Caml's Marshal module, serialization is
now done by WDialog itself, increasing security.

WDialog is hosted at Sourceforge, and you find links to all relevant
documents on the homepage:

Of course, you can also get the new version by GODI.


Feature list

      * Separation of the user interface (UI) definition from the
        backend program, improving the structure of the application and
        enabling advanced software engineering processes 
      * The UI definition is contained in an XML file, and it describes
        the whole UI from the overall dialog structure to the style of
        the individual HTML element
      * The dialogs have built-in persistency for session state. The
        HTML form elements can be tied to dialog variables reflecting
        their current state
      * A powerful template system manages the combination of individual
        HTML fragments to whole pages
      * The dialogs behave like GUI widgets. They visualize the state of
        the session, and user clicks are treated like events that are
        handled by programmable callback methods 
      * The callbacks are written in a real programming language
        (Objective Caml, or Perl), making it possible to formulate all
        algorithms and to use all system resources
      * The application can run as CGI as well as application server
        (now also with FastCGI)
      * The WDialog toolkit itself does not require any database as
        backend store (but can do so, optionally)
      * WDialog preprocesses all web inputs, and ensures that certain
        security standards are fulfilled

Mini ray tracer


Jon Harrop announced:
I've been fiddling with my ray tracer again this weekend. This time I've come 
up with a comparison of four different (progressively optimised) versions of 
the ray tracer implemented in C++, Java, OCaml and SML:

OCaml is significantly more concise that the other languages (even SML) but 
the big surprise for me was the incredible performance of straightforwardly- 
written Mlton-compiled SML, even on AMD64 where it lacks a native code-gen.

First release of AlphaCaml


Francois Pottier announced:
It is my pleasure to announce the initial release of alphaCaml.

AlphaCaml is a tool that turns a so-called ``binding specification'' into an
Objective Caml compilation unit. A binding specification resembles an
algebraic data type declaration, but also includes information about names and
binding. AlphaCaml is meant to help writers of interpreters, compilers, or
other programs-that-manipulate-programs deal with alpha-conversion in a safe
and concise style.

In short, alphaCaml can be understood as an alternative to Fresh Objective
Caml. It takes the form of a code generator and a library, instead of a set of
patches to the compiler and runtime system. Furthermore, its binding
specification language is more expressive.

An introduction to alphaCaml is available at

The source code is available at

Installation requires Objective Caml and findlib. A GODI package is also
available now.

This is an initial release. There is a lot of progress to be made. Comments,
suggestions, and criticism are welcome. Authors of systems (written in
Objective Caml) where alpha-conversion is an issue are warmly encouraged to
try it out and to make their impressions public!

OC-SOAP 0.3.0 - a proper SOAP interface for OCaml


Richard Jones announced:
I'm pleased to announce a very early and experimental release of
OC-SOAP for OCaml.

This is a proper version of a SOAP client for OCaml, which uses CDuce
( to parse WSDL + XML Schema interface
descriptions, turning them into SOAP client stubs.

This version works correctly for the Google Adwords API, and so other
SOAP APIs which use different features may not work, although support
shouldn't be too difficult to add.

You will need to install the following packages first:

 * ocamlfind
 * ocamlnet (netclient and netstring)
 * PXP
 * extlib
 * cduce
 * calendar

This version is distributed under the LGPL + OCaml linking exception.
A better version and website will follow shortly.

Many thanks in particular must go to Alain Frisch for promptly
answering my mostly stupid questions about CDuce over on that mailing

Yaxpo XML parser


Mike Lin announced:
I have gotten a few requests to revive the Yaxpo XML parser which I
wrote a few years back. I have restored the web site at a new location
in case anyone missed it.



2002-07-25  (03:06)
Mike Lin
[Caml-list] yet another xml parser

none of the ocaml xml parsers out there quite served my needs, so i
wrote my own. for anyone who's interested, i put up a page about it.

the most interesting thing about the parser is that it is all hand
written in explicit continuation-passing style (CPS) instead of using
recursion or iteration. this allows one to do some amusing things in
clever ways; for example, it is possible to "pause" parsing, returning
control to the caller, and then pick up where it left off at some later

i am using the parser in conjunction with another project i'm working
on. it's still quite preliminary, but i'm using it already to do some
'real' stuff, so i hope it can eventually be useful standalone.

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