Previous week Up Next week


Here is the latest Caml Weekly News, for the week of April 08 to 15, 2008.

  1. maintainer needed for CamlTemplate
  2. CDuce is now in Fedora
  3. break and continue for OCaml
  4. List of sites running in Ocaml?
  5. break and continue v2

maintainer needed for CamlTemplate


Benjamin Geer said:
The CamlTemplate library ( needs a 
new maintainer, as I unfortunately no longer have time even to apply 
the occasional patches people send me.  If anyone here uses the 
library and would be interested in maintaining it, please let me know.

CDuce is now in Fedora


Continuing this thread from March, Richard Jones said:
It's now in testing in Fedora 8, so you should just be able to install 
cduce directly without enabling any extra repositories.

break and continue for OCaml


Sanghyeon Seo announced:
I have the first cut of patch to implement break and continue inside 
for and while loops for OCaml. 

Patch is against OCaml 3.10.2. All the meat is in bytecomp/ 
Currently bytecode only. I am working on natvie code and error 
handling when break is used outside loop etc but I thought "releasing 
early" could be useful. 

What do you think?
Among the many answers, Luc Maranget said:
I think that you can implement break/continue without altering
the lambda-code (file bytecomp/lambda.mli) by using the existing
'static exception' mechanism :

| Lstaticraise of (int * lambda list)
| Lstaticcatch of lambda * (int * Ident.t list) * lambda

with the following pretty printing convention (cf. option -dlambda)

(exit i) stands for 'Lstaticraise (i,[])'
(catch e1 with (i) e2) stands for 'Lstaticcatch (e1,(i,[]),e2)'

Then you have for instance
while e1 do e2 done ->

 (while (e1) (catch  e2 with (icont) ())
with (ibreak) ())

In the loop body e2, break is compiled into (exit ibreak)
and coninue into (exit icont).

It is a bit complicated, but then you get native code compilation for

PS> I make no statement on whether break/continue
   should be added to ocaml!


     1. Exceptions are already here and they express more flexible
        control flow modifications.

     2. Adding keywords is something that is not easily accepted,
        because it breaks existing code.

List of sites running in Ocaml?


Berke Durak said:
Ocsigen seems to have sparked an emerging interest for web frameworks written
in functional languages. I'd like to compile an exhaustive list of pages or
sites using Ocaml as frontends or backends, with the technologies they use.
Please do not hesitate to add any past or present running Ocaml site or page,
even if its a personal site.

Public sites:
* Gerd's Camlcity:
* The Ocsigen site itself:
* The Merjis site and Cocanwiki:
* The ara and anla servers, part of the EDOS project : Runs using a small
  multithreaded HTTP module, with gzip compression, and a simple sum type for
* I'll insert a shameless plug for a comic strip in french, Massacre à la
  Ronchonneuse (, which runs under my pet Ocaml
  framework thru lighttpd + SCGI; thanks to Sexplib for the persistance!

Many other people rolled their own HTTP servers (for instance Stefano
Zacchiroli's ocaml-http). Please tell if they are or were running somewhere.

* Does run under Ocaml?

Off-line generation:
* Alain Frisch's personal site: generated using Cduce,
  of course

* The Caml Humps, which I assume run as Ocaml CGI scripts:
* Aurochs parser demo: (mine)

* I have been told Wink uses Ocaml as a backend.

* Impala at INRIA
* From my Paris 7 days I recall a webapp to allocate teachers and assistants
  to courses. I seem to remember that it was written in Ocaml? I'm sure there
  are other internal apps at Paris 7 in Ocaml.

Possible candidates:
* Lexify
* Jane Street
* Haxe and Motion Twin
After many replies, Berke Durak then said:
Thanks for your replies. I've created a list at the Cocan wiki. Please correct
any inaccuracies and provide details, if you can, about what you used.

I don't know what the owners of the COCAN wiki would think about it, but IMHO
it would be appropriate for the authors/maintainers of these sites to explain
the techniques they used in a small page.  Some performance metrics could also
make "dynamic fanboys" envious (I'm thinking of Ruby users frustrated by the
excruciating slowness of that language). This could also apply to other
software projects.

Think of prospective new users looking for what they could do in Ocaml.

BTW the COCAN wiki is a great place for centralized information and the wiki
itself is a joy to use.

PS. I've also added an "Ocaml success stories" page with a list of well-known
Ocaml software (coq, unison, mldonkey, etc.)

break and continue v2


Seo Sanghyeon announced:
This is the revision of break/continue patch I sent. 

This patch no longer modifies lambda code, and uses static exception 
instead. bytegen is restored, and break/continue target stack is moved 
to translcore. 

simplify_exits is modified to track whether exit is in tail position. 
It no longer replaces exit with handler when exit is not in tail 
position. This is done with two hash tables; I'd like to hear 
suggestions for better implementation.

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