Previous week Up Next week


Here is the latest Caml Weekly News, for the week of October 14 to 21, 2008.

  1. OCaml version 3.11.0+beta1
  2. Camlp5 5.10 compatible with OCaml from 3.08.0 to 3.11.0 included OK
  3. Decent Java parser written in Ocaml?
  4. Camelia progress
  5. Autocompletion

OCaml version 3.11.0+beta1


Damien Doligez announced:
Dear OCaml Users,

We are pleased to celebrate the birthday of Friedrich Nietzsche
by releasing OCaml version 3.11.0+beta1.  We need YOU to test
it thoroughly and report any problems you might have.  Does
your favorite software work with it?

It is available as a source release only (plus documentation),
from this address:

It is also available from our CVS server at:
Use tag "ocaml3110beta1" to get the beta release, and tag
"release311" to track the bug fixes between this and the
final release of 3.11.0.

Have fun and PLEASE send us some feedback, positive or negative.

-- The OCaml team.

--------------------- Camlp5 HOW-TO ------------------------

Camlp5 version 5.09 does not work with OCaml 3.11.0+beta1 out of the
box.  A new version compatible with OCaml 3.11.0 should be released
very soon.  In the meantime you can use the following commands (in the
root directory of the Camlp5 5.09 sources) to compile Camlp5 5.09 with
OCaml 3.11.0+beta1.  Note that you will need to provide the path name
to a copy of the OCaml 3.11.0+beta1 sources at the line labelled

cp -R ocaml_stuff/3.11 ocaml_stuff/3.11.0
cp ocaml_src/main/ast2pt.ml_3.11 ocaml_src/main/ast2pt.ml_3.11.0
ed main/ <<-EOF
 g/OCAML_3_11/s//& OR OCAML_3_11_0/
ed top/ <<-EOF
 g/OCAML_3_11/s//& OR OCAML_3_11_0/
../configure --transitional
make steal OCAML_SRC=<path-to-ocaml-source-dir>      # HERE
make core
make bootstrap_sources
../configure --transitional
make world.opt

That's all.  Now you can "make install" as usual.
Dario Teixeira then said:
Great news, thanks!  One note to GODI users: trying out the beta
version is very simple; just ask GODI to build the godi-ocaml and
godi-ocaml-src packages, and configure the latter one by setting
OCAML_CVS_CHECKOUT to "yes" and OCAML_CVS_REVISION to "release311"
(or "ocaml3110beta1" if you want the Beta 1 static snapshot).
GODI will then automatically recompile all packages.
Jaap Boender also said:
For ease of testing, I've very quickly updated the FreeBSD port (lightly 
tested, as in "it seems to work for me"). It is available at (to be untarred at the 
root of your ports tree).
Andres Varon asked and Alain Frisch answered:
> Thanks for the good work. I would like to know exactly what 
> architectures support the native Dynlink? I did not see this information 
> in the release notes. 

The native Dynlink is known to work under Linux x86, Linux AMD64, Win32 
(mingw/msvc ports). It has been lightly tested under Win64, some flavors 
of BSDs and also the Cygwin port.
Daniel Bünzli asked and Alain Frisch answered:
> And on macosx ? It seems here on 10.5.5 that only dynlink.cma and 
> dynlink.cmi for bytecode get installed. So I guess there's no support. 
> What about the future ? 

Native dynlink used to work on Mac OS X < 10.5 (x86 only). The new 
linker in 10.5 does not support linking shared libraries with non-PIC 
code. It is still possible to use the old linker, called ld_classic, but 
some libraries (like X11) does not work, so this has been disabled in 
the configure script. 

The clean solution to make natdynlink work on recent Mac OS X systems 
(beside convincing Apple to support the old behavior of their linker in 
their new implementation) is to change OCaml's x86 backend so that it 
produces only PIC code (this has been done for the AMD64 port). I don't 
think there is currently any plan to work on that.
Andres Varon then said:
I'm glad to report that I just tried with XCode 3.1.1 and the linker   
did not complain (as it did with XCode 3.0). I wrote a little test and   
the native Dynlink worked with that version of XCode  (using 10.5.5,   
Intel -- I had to drop an -I flag in the linker call from the OCaml   
compiler when I was trying it).

Camlp5 5.10 compatible with OCaml from 3.08.0 to 3.11.0 included OK


Daniel de Rauglaudre announced:
Camlp5 5.10 compatible with OCaml from 3.08.0 to 3.11.0 is OK. 
Documentation and download at:

Decent Java parser written in Ocaml?


Sung Kim asked and Eric Cooper answered:
> Currently I'm looking for a Java parser. Is there anyone aware of a 
> decent Java source code parser written in Ocaml? 

I wrote a simple Java parser and pretty-printer several years ago: 
I'll let you decide whether it's "decent".  This was before the 
addition of Java generics, so it could use some updating.

Camelia progress


Kuba Ober:
Here's the update from the trenches: I'm about 75% done
porting Camelia code to Qt4, the editor-related parts took
longer than anticipated since a lot of code had to change due
to the arguably better way that Qt4 handles text editing. The
code shrinks quite a bit in the process (20% or so, per the line
counts), so that's hopefully good ;) The debugging will surely
take quite some time.

I'm in the process of getting admin rights to the sourceforge
project and setting up an SVN repository for the code.

The upcoming version will be 2.0, and I hope to add some features
to it before it's final. I'm sure of Ocamlbuild support.
Any other features that people would like?

I'll keep you guys posted, this is obviously a "slightly"*
larger project than initially anticipated, but the codebase
is OK to work with, and it'll have way more features than
anything done from scratch in a weekend would ;)

My plan is to have the final 2.0 release support all OCaml builds
out of the box on Windows (MSVC, MinGW and Cygwin), although
I will put 3.11.0 as the minimum supported version of OCaml
due to debugger and other woes. Linux and OSX will also be
supported; Linux-wise I can only test on FC9, but bug reports
will be welcome of course.

Cheers, Kuba

* - "slightly" in the log scale, so just one order of magnitude
is "not much" ;)
Someone asked, and Kuba Ober answered:
> In the meantime, is there a public source control with the current version 
> or a tarball? (I'd just like to take a look at the code, not necessarily 
> run it). 

SVN is in the usual location. The original 1.1 release from 
a couple years ago is tagged, and I'm chopping away at it in the trunk. 

Browse it at: 

svn co camelia
Kuba Ober later added:
I know that the indenter support will be gone at least for the alpha version,
as the indenter needs a revamp -- the QSyntaxHighlighter machinery
can be (ab)used to modify the text in-place, and will most likely host
all of the indenter. Right now, indenter has a big bunch of regexps and
is a bit hard on the eyes. What I will do instead is to tokenize each
line and work off the token stream; I expect this will cut the code size
a lot.

The syntax highlighter has a notion of state for each line, and
the state of preceding line, and is automatically invoked by Qt whenever
the lines change. I have to check, but I think it is also invoked when the
state of the preceding line changes. So it's fairly easy to work with.

Anyway, the plan is not to drop features, so the final release will have
a hopefully nice indenter and whatnot.

Also note that I'm submitting everything to SVN pretty much as I go, and
I try to keep the code compileable, so if anyone feels like contributing,
let me know. It may be easier to work on it once it all gets to compile,
which is still one file away and I will of course brag once it hits
the "it compiles and pretends to run" mark.



Deep into this thread on IDE, Peng Zang said:
I have written smart autocompletion based on the toplevel in a mode I call 

I've never gotten around to announcing it because it takes time to polish up 
and write good doc... time that I haven't had of late.  However, I have been 
using it myself for a while and a handful of random people have emailed me 
about it and it works with them so, it may work for you.  Now seems as good a 
time as any to tell people about since I've held off for over a year saying 

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