On 2007-08-16, at 10:10, Joel Reymont wrote:

Is it possible to write a JIT VM in OCaml?

It seems that this should not be possible as OCaml does not allow for code generation at runtime. Am I mistaken?

Sure. You could write a compiler and assembler in ocaml. But you'd need to write glue code in C or assembly to convert the ocaml representation to machine data structures, and to call into your ocaml-based compiler implementation on-demand when a function is called.

But to compile your language/bytecode to ocaml source, and then JIT compile that? No help there, no…

— Gordon