Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
JIT VM in OCaml: Impossible?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-08-16 (16:24)
From: Gordon Henriksen <gordonhenriksen@m...>
Subject: Re: [Caml-list] JIT VM in OCaml: Impossible?
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