Previous week Up Next week


Here is the latest Caml Weekly News, for the week of 04 to 11 October, 2005.

  1. ocamldap 2.1.5
  2. Automatic interfacing of ocaml to c?
  3. the shootin is not the shootout
  4. Looking for a configuration file library
  5. where is GMain and ...

ocamldap 2.1.5


Eric Stokes announced:
I am pleased to announce the immediate availability of Ocamldap 2.1.5.

(NOTE to hump maintainers, since 2.0 Ocamldap has been a native Ocaml  
   it should no longer be categorized as a binding to a C library)

Ocamldap is a toolkit for working with LDAP directory services,  
features include
- A full featured, high performance LDAP client library
     - A set of low level primitives similar to the C library
     - A high level object oriented interface
     - Schema aware local object representations
     - An experimental library for account management
     - An experimental implementation of transactions  
- A library for constructing LDAP servers
- An rfc2252 schema checker
- An LDIF v1 parser and pretty printer (including change records)
- An ldap filter parser and pretty printer
- An ldap dn parser and pretty printer

Major Changes Since the Last Announce
- Major improvement in the documentation
- I spent a lot of time with Apple's excellent Shark tool, and was  
able to get a 2.5x decoder speedup (Parsing 4.0 Mb/s of BER on an  
800Mhz G4). Based on the data I'm seeing from Shark I do not expect  
any further major performance increases in the decoder, but given the  
level of performance it is currently at, and the age of my hardware,  
I see no reason to care.
- Experimental implementation of transactions across multiple objects
- Some bug fixes

Ocamldap is available on GODI, and via

Automatic interfacing of ocaml to c?


Chris Campbell asked and Jon Harrop answered:
> Has anyone done any work on this?


> I'm in the process of attempting a 
> semi autogenerated binding to opengl using the mesa xml specifications
> of the interface and lablgl.

Have you seen Isaac Trott's idlgl bindings, written using camlidl?

> This is very early days; so far all I've 
> done is map the flat (a portion of the) gl enumeration space to a set
> of types and values, then auto generate tables mapping the ml variants
> to gl enumeration values ala lablgl.
> I have a good idea of what it will do and am just looking for advice
> from anyone who has done this sort of thing before (if any).

I have tried and failed to write bindings to the more complicated (read 
"hideous") parts of OpenGL and GLU, specifically the GLU tesselator.

> The main 
> problems so far arise from the flat gl space and wanting to split that
> up into a more friendly set of types and modules.

There are also problems with typing, e.g. sets of related functions that 
handle polymorphic metadata of the same type between each of the functions. 
This could be implemented using functors, records of functions or objects. 
I'm not sure if it would be better to do more on the OCaml side using Obj or 
to use C.

> In fact, I will only 
> be generating the mundane stuff as some of this mapping is quite
> tricky and using that as a base.  Many of the opengl functions are
> trivially mapped to OCaml but those that don't will be hand coded.

I'm keen to see your results! :)

the shootin is not the shootout


Jack Andrews announced:
you may have noticed the 'shootin' mentioned  
somewhere. is like  
'the great computer language shootout' but your  
solutions are not restricted by the 'same-way'  
criterium.  you can implement solutions with any  
algorithm as long as it produces the same results.

even this criterium may be loosened to include  
'almost the same' solutions.

the first and current spec is here:

the topic is 'automated stock market trading' and  
the spec is still under development.

i hope this grabs your interest

Looking for a configuration file library


Continuing the thread from last week, Richard Jones said:
> For easy configuration of my programs, I'm looking for some OCaml code
> to read and write a user configuration file.

This is probably not directly relevant to you, but we have had a lot
of success using comma-separated values (CSV) files for configuration.
Our "configuration" requirements consist mainly of long lists of
advertising campaigns and targets, so obviously CSV files make a bit
of sense here.  Our campaign manager edits the CSV files using Excel.
The CSV files translate into in-memory 'string list list' structures
and are thus simple to iterate over and generate.

where is GMain and ...


Deep into this thread, Jeremy O'Donoghue said and T. Kurt Bond added:
> Your first message suggests that you are compiling for Windows, which
> means that you're in for a tough ride. Lablgtk2 is an Ocaml binding
> for Gtk 2.x, which is a popular Linux/Unix widget set. There is a
> Windows port, but it is quite painful to install (I should know, I did
> it a couple of weeks back...)
> Go to and
> download lablgtk-2.4.0.tar.gz. Note that you cannot use the Windows
> binary package if you want to compile with ocamlopt.
> Unzip and untar, and read README and (especially) README.win32 carefully.
> Go to and download
> the required binary installer packages (there are a lot of them). You
> will need both runtime and developer files.

I find it much less painful to get all the Win32 Gtk+ development libraries
from the distribution the Gaim folks publish, since they package them
up in one tar.gz:

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