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
[Caml-list] Writing a JIT compiler
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-06-25 (10:00)
From: Basile Starynkevitch [local] <basile.starynkevitch@i...>
Subject: Re: [Caml-list] Writing a JIT compiler
On Fri, Jun 25, 2004 at 09:04:09AM +0100, Jon Harrop wrote:
> I'm trying to convert an interpreter written in OCaml into a JIT compiler. 
> Generating OCaml code from host code seems to be the best way to do this as 
> the generated code can then use the interpreter's data structures and 
> functions.
> However, I'm currently creating temporary source files, calling ocamlopt and 
> using marshalling to another temporary file in order to get the data back and 
> forth.
> Is there a better way of doing this?

Definitely have a look at

You did not explain why are you writing a JIT (speed issues?) and what
is the target language (x86 machine code, assembler, C, Ocaml?)  of
your JIT.

You might generate "lambda" representation (see
ocaml/bytecomp/lambda.mli) of the compiler, or at least typed trees
(see ocaml/typedtree.mli).

You might use MetaOcaml see

Some of their papers might help:

You might generate C-- code: see


Basile STARYNKEVITCH -- basile dot starynkevitch at inria dot fr
Project - phone +33 1 3963 5197 - mobile 6 8501 2359 --- all opinions are only mine 

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: