[LLVMdev] [Caml-list] Ocaml(opt) & llvm

Jon Harrop
Mon, 26 Nov 2007 19:51:21 -0000

On Monday 26 November 2007 19:30, Gordon Henriksen
wrote:
> It might be exciting to have an Ocaml with "exec" (surely it
would
> allow new classes of programs), but static compilation seems clearly
> superior for existing programs, so my focus is there for now.

There are various different approaches to this, of course, but having tried
the Lisp and MetaOCaml approaches I think the best way is probably to exploit
LLVM's JIT facilities directly. The problem is simply that any abstractions
impose significant performance overheads that are large enough to undermine
the point of having an "exec" in the first place.

So I would not recommend putting too much effort into an "exec" for
OCaml. I
think it would be more productive to port OCaml's regular expression engine
to use LLVM's JIT facilities directly, for example.

>   1. The ocaml exception model is quite unique; emulating it seems
> unlikely. DWARF exceptions are a suitable but incompatible replacement.

Do you mean that LLVM cannot generate exception constructs in the format
reqired by OCaml's run-time?

--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.