Previous week Up Next week


Here is the latest Caml Weekly News, for the week of 09 to 16 March, 2004.

  1. Completeness of "Unix" run-time library
  2. IBM OCaml grant?
  3. Development versions: ocamlconf, ASPCC
  4. ocamlconf-0.1
  5. Ocaml XML-RPC
  6. OCamlODBC on Gna!

Completeness of "Unix" run-time library

Shawn Wagner answered the following thread:
Richard Jones wrote:
> Vasili Galchin wrote:
> > Hello,
> >  
> > I have yet to finish reading through otherlibs/unix/unix.mli. I kind of 
> > consider this POSIX API support. In any case, is there is a consensus that 
> > what is in unix.mli is complete? Or does new functionality have to be 
> > added? If so, what?
> No way!!  There's lots of missing stuff which could be added.  eg. off
> the top of my head, strftime(3).

Some missing functions from the C and POSIX standards are in my extlib
library (strftime is Time.format_time).

More (The numeric ones added in C99) are in the companion mathlib.
Vasili Galchin said:
Judging by the replies there seem to be several issues vis-a-vis the Unix 

1) Below is email that Gregoire sent to me personally. (Gregfoire, I hope you 
are not angry at me for posting your email to me). I have looked at his code 
only very quickly. I saw that someone else has also added socket functionality 
but I am sorry I have not yet read it yet. I made a (feeble??) attempt at 
adding ipv4 multicast functionality (because multicast is lacking). Gregoire 
code seems to have implemented very complete and very elegant. Please see next 

2) I am an old man (53). I have worked in industry for 28 years in US (the 
headquarters for uber pragmatism!!! ... sorry to say frequently we sacrifice 
quality for time). It seems like a lot of you have done very nice and 
excellent/elegant work vis-a-vis the "Unix" library.

Question: why has not all this work  been folded into the OCaml run-time 
library? I.e. there seems to be a backlog of very valuable contributions that 
would make OCaml compete with C/C++ ... oh yes in industry managers will point 
at OCaml and say " ah ha ... it has many holes!!!".

Lecture: ( gentle lecture from an older person) Before I die I would really 
like to see declarative lanaguages, e.g. functional languages, logic languages, 
etc. "catch" on in industry. I see OCaml as a very good candidate based on the 
existing code base.  Every day I write in imperative languages like C/C++ which 
have a host of correctness problems (memory leaks) and expressibility problems 
(functions are not 1st class citizens). I don't want to see OCaml be a science 
project. It seems to need a complete POSIX API library (and  possibly Win32 API 

3) Frankly I think that instead of Unix library it should be called the POSIX 

4) Based on the counterpostings, I am thinking that maybe a (the?) solution is 
for the "Unix" library to be broken up into several libraries (OCaml modules) 
under a POSIX directory with subdirectories (e.g. a socket subdirectory). 
Afterall if you look at Gregfoire's work on sockets, his new code ONLY deals 
with sockets. Bottom line: I really think that the Unix/POSIX support needs to 
be split up. I haven't looked at the POSIX standard in a while so I am not sure 
how to do that. Of course, we don't want to rebuild the Pyramid of Cheops, i.e. 
perhaps this is something that can be phased in (industry programmer talking).

5) Another issue is how to merge ipv4 and ipv6!?

I hope I have made some sense. I also sorry I cannot find how to turn off HTML 

Kind regards, Vasili

--- Gregoire HENRY wrote:
> Hello,
> I have added so far the multicast join and drop functionality to the unix 
> (and threads) OCaml library. I have tested this functionality and it works. I 
> do want to respect what has been implemented in the past (very fine work). I 
> looked carefully at the various setsockopt functions in unix.mli and the 
> multicast work didn't seem to fit easily within the bool, int, float 
> paradigmn because the setsockopt call for multicast passes in a structure 
> plus the setsockopt "level" actual parameter is not SOL_SOCKET (i.e. we are 
> setting socket state at a different level, i.e. IPPROTO_IP).  Hence, I 
> implemented as two functions, multicast_join and multicast_drop. I, of 
> course, amenable to changes in what I have done. Is there a code review 
> process in order to get something into the mainline of OCaml?? Please someone 
> supply me with details.  
> I believe there is no special review process yet, except perhaps filling a 
> request's bug and attach your patch :
> BTW, I missed your previous mail but I make some preliminary work this summer 
> on bindings OCaml with IPv6 socket interface (RFC 3493).  In particulary, 
> introduce a new setsockopt_multicast. 
> I would be pleased to compare with your implementation.
> You can found mine here :
> regards,
> -- Gregoire Henry

IBM OCaml grant?

Vasili Galchin asked and Christian Lindig answered:
>Does anybody remember seeing a announcement from
>IBM concerning a grant for OCaml development?

Somebody pointed to the Eclipse grants from IBM. Eclipse is an IDE
mainly used for Java but the poster suggested to use it for OCaml

Development versions: ocamlconf, ASPCC

Kenneth Knowles said and Markus Mottl announced:
> *     OcamlMakefile is awkward with multiple targets (such as suites
>       of utilities) and I'd rather write (or depend on) a simple ocaml
>       script than a complex Makefile

I have taken this criticism as motivation to make OCamlMakefile more
useful with subprojects (i.e. multiple targets).  The newest release is
now available and should make this task much simpler.

Here is an example from the distribution on how to specify two

# Set OCamlMakefile to use
export OCAMLMAKEFILE = ../OCamlMakefile

# Export some common variable settings
export THREADS = yes

# Define project "ex1"
export PROJ_ex1 = \ \

# Define project "ex2"
export PROJ_ex2 = \ \

# If the environment does not define subprojects to handle,
# then use "ex1 ex2" as default
ifndef SUBPRJS
  export SUBPRJS = ex1 ex2

# Default target to use
all:    bc

# Catch-all target will be applied to all subprojects automatically
        @make -f $(OCAMLMAKEFILE) subprjs SUBTARGET=$@

You can use the usual shortcuts like "make nc" (= build native code),
etc., for compiling several subprojects at once.  Setting/exporting
variable "SUBPRJS" in the shell environment or passing it to "make"
on the command line allows you to refer to any subset of your projects
that should be affected by the next command.  I think this is as easy
as things can get - but feel free to send me suggestions for improvement!


Kenneth Knowles announced:
OcamlConf 0.1 is ready.

Significant changes have occured in that it uses an applicative Map rather than
a Hashtbl to store the configured values, and in general the interactive
"./configure" portion has been improved a lot (as opposed to the Makefile

I've thrown together a web-page, and real releases.  The DARCS inclined can
still get the latest at if I've
configured my new firewall correctly - they are tagged as "0.1"

Direct URLs to tars:

From the web page:

    * Simple "./configure; make; make install" operation.
    * MakeMake module for outputting your makefile based on specifications
    * Conf module for prompting the user for compile-time options, as well as
    * locating libraries (usually via findlib)
    * Util module with some useful shell and string functions

How Good is the Generated Makefile?

    * Makefile is about as simple as a hand-written one.
    * Contains a 'normal' and a '.opt' target for each program or library
    * Typical targets for: install, install-opt, uninstall, clean, distclean,
      doc, all, opt, tar, gzip, bzip2


Shawn Wagner announced:
Presenting version 0.2.0 of my XML-RPC library for ocaml, available at

New in this version: Support for acting as a RPC server, not just as a

OCamlODBC on Gna!

Maxence Guesdon announced:
Since :
- some people wanted to add features in OCamlODBC,
- I don't have the time to do it myself,
- and I'm not an ODBC expert,

I just moved OCamlODBC to Gna! :

so that other developers can easily contribute to the library.

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