Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Basile Starynkevitch [local]" <basile.starynkevitch@inria.fr>
To: Jon Harrop <postmaster@jdh30.plus.com>, caml-list@inria.fr
Subject: Re: [Caml-list] Writing a JIT compiler
Date: Fri, 25 Jun 2004 11:59:36 +0200	[thread overview]
Message-ID: <20040625095936.GA2041@bourg.inria.fr> (raw)
In-Reply-To: <200406250904.09178.postmaster@jdh30.plus.com>

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 http://cristal.inria.fr/~starynke/ocamljit.html

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 http://metaocaml.org/

Some of their papers might help:
http://www.cs.rice.edu/%7Etaha/publications/conference/gpce03b.ps
http://www.cs.rice.edu/%7Etaha/publications/preprints/2004-02-16.ps
http://www.cs.rice.edu/%7Etaha/publications/journal/tcs00.pdf

You might generate C-- code: see http://cminusminus.org/

Regards.


-- 
Basile STARYNKEVITCH -- basile dot starynkevitch at inria dot fr
Project cristal.inria.fr - phone +33 1 3963 5197 - mobile 6 8501 2359
http://cristal.inria.fr/~starynke --- all opinions are only mine 

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  parent reply	other threads:[~2004-06-25 10:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-25  8:04 Jon Harrop
2004-06-25  8:52 ` Benjamin Geer
2004-06-25  9:53   ` Jon Harrop
2004-06-25 10:56     ` Basile Starynkevitch [local]
2004-06-25  9:59 ` Basile Starynkevitch [local] [this message]
     [not found]   ` <200406251325.15940.postmaster@jdh30.plus.com>
2004-06-25 15:55     ` Basile Starynkevitch [local]
2004-06-25 17:05       ` Daniel Bünzli
2004-06-26 13:45       ` [Caml-list] " Julian Brown
2004-06-26 19:18         ` Basile Starynkevitch [local]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040625095936.GA2041@bourg.inria.fr \
    --to=basile.starynkevitch@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=postmaster@jdh30.plus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox