lightning
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lightning] Compiling C to Lightning


From: Basile STARYNKEVITCH
Subject: Re: [Lightning] Compiling C to Lightning
Date: Tue, 23 Aug 2005 12:18:42 +0200
User-agent: Mutt/1.5.10i

Le Tue, Aug 23, 2005 at 11:11:58AM +0200, Ludovic Court?s écrivait/wrote:
> 
> What's `c?  Pointers?  Googling for it proved to be hard.  ;-)

Google for tickc http://pdos.csail.mit.edu/tickc/

> Basically, I'd like to be able to generate a sequence of `jit_'
> instructions from C code (or a subset of C).  There are many good
> reasons for it, one of them being that it's usually easier to write C
> code than assembly.

You don't write assembly, but you could write jit_ macros. Of course,
these are lightning specific, but if you want to use Lightning, at
some point you should call Lightning specific macros :-)

> Of course, the ultimate tool would be a GCC back-end that produces
> Lightning assembly...

Consider using LLVM.

> 
> How did you address similar issues in OCaml

Ocaml generate bytecode (for the Ocaml VM, which is a stack based
virtual machine specific to Ocaml). The Ocamljitrun program just
translate Ocaml bytecode to machine code, by invoking GNU lightning
macros. Basically, it is just a rewriting of the big switch of the
Ocaml VM interpreter, where each case is a small sequences of
Lightning macros calls. Of course, the evil is in the details (eg
managing the bytecode to native code relationship, and some peepwhole
optimisations).


http://cristal.inria.fr/~starynke/ocamljit.html

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/ 
email: basile(at)starynkevitch(dot)net 
8, rue de la Faïencerie, 92340 Bourg La Reine, France




reply via email to

[Prev in Thread] Current Thread [Next in Thread]