Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] Ocaml(opt) & llvm

2 views
Skip to first unread message

Basile STARYNKEVITCH

unread,
Nov 26, 2007, 1:28:07 PM11/26/07
to Caml Mailing List, LLVM Developers Mailing List
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.
http://lists.cs.uiuc.edu/pipermail/llvmdev/2007-November/011481.html
http://lists.cs.uiuc.edu/pipermail/llvmdev/2007-November/011507.html

However, to generate code with LLVM for Ocamlopt, this is not enough,
since while LLVM does have hooks to support garbage collection
http://www.llvm.org/docs/GarbageCollection.html
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
Ocaml.

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} ***

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Gordon Henriksen

unread,
Nov 26, 2007, 2:32:16 PM11/26/07
to caml...@inria.fr
On Nov 26, 2007, at 13:27, Basile STARYNKEVITCH wrote:

> 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.

> [...]

To avoid cross-posting, my followups to this thread will be on llvmdev.

http://lists.cs.uiuc.edu/pipermail/llvmdev/2007-November/011527.html

— Gordon

0 new messages