On Friday 01 January 2010 16:45:34 Joel Reymont wrote:
> Does anybody have example code that shows how to generate OCaml bindings at
> runtime with LLVM?

The OCaml Journal article "Calling C code from OCaml" (10th July 2008) 
described an OCaml program that invoked a C function both via a stub written 
in C and via JIT compiled interface code using LLVM (no more stinking C 
stubs!).

I would like to write more on JIT-compiled interface code in the future and 
perhaps write a library to make it easy.

> My goal is to compile an AST into code that uses OCaml functions within the
> same binary that's doing the compiling.
>
> I don't think it can be done with OCaml since it requires a standalone
> assembler, linker, etc. Correct me if I'm wrong, though. Mine is a
> web-based compiler with potentially many concurrent sessions. Running gas,
> ld, etc. seems a much heavier and less scalable approach that generating
> code at runtime.

Sounds like you really want HLVM. :-)

>       Thanks and Happy New Year, Joel

Happy New Year!

-- 
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e

_______________________________________________
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

Reply via email to