English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Ocaml(opt) & llvm
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-11-26 (18:27)
From: Basile STARYNKEVITCH <basile@s...>
Subject: Ocaml(opt) & llvm
Hello All (to Ocaml List & CC LLVM list)

As some might probably know, the LLVM compiler http://llvm.org/ has (at 
least in its latest SVN snapshot) a binding for Ocaml. This means that 
one could code in Ocaml some stuff (eg a JIT-ing compiler) which uses 
(and links with) LLVM libraries.

However, to generate code with LLVM for Ocamlopt, this is not enough, 
since while LLVM does have hooks to support garbage collection
I don't know of any actual hooks to fit into the needs of Ocamlopt 
garbage colector (which AFAIK require some specific frame descriptors in 
the code, in some hashtables, which details are tricky and known to very 
few implementors, perhaps only Xavier Leroy & Damien Doligez).

So is there any code to fit the Ocaml GC requirements into LLVM 
abilities, ie to use LLVM to generate (eg JIT) code which respect Ocaml 
GC requirements.

Of course, I do know that there are some typing issues and theoritical 
points which I deliberately ignore here. I'm supposing the guy wanting 
to LLVM for Ocaml is knowing that he seeks trouble.

And Metaocaml is (unfortunately) nearly dead: future (in ocaml 3.11 or 
3.12) dynamic libraries ability is not a full replacement! Even if one 
might generate Ocaml code and compile & dlopen it in a future version of 

Thanks for reading.
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***