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
Compiling Ocaml sources to c sources
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-09-15 (18:17)
From: Eray Ozkural <examachine@g...>
Subject: Re: [Caml-list] Compiling Ocaml sources to c sources
On Wed, Sep 15, 2010 at 8:36 PM, Jon Harrop <> wrote:

> >   * Hacking a C generator inside Ocaml is non-trivial, because of the
> >     garbage collector, currified function calls, and tail recursion
> >     etc.
> BTW, I was always surprised nobody had converted the bytecode interpreter
> into a via-C compiler by unwinding the C code the interpreter goes through
> to execute a specific OCaml bytecode program. You could even use this with
> something like Clang to get JIT compilation to native code. Not very
> efficient but surely much faster than interpreted bytecode...

Hmm, this would only optimize the bytecode fetch/decode step of the ocaml
execution cycle. I am not sure that it will result in much real-world

In fact, that seems to be the main problem with many of these so-called JIT
interpreters, which in my opinion, do not seem to have learnt from the HAL
architectures of IBM OS's etc. Was probably also the problem with Transmeta;
cheap compilation entails cheap performance.


Eray Ozkural, PhD candidate.  Comp. Sci. Dept., Bilkent University, Ankara