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: Mon, 22 Aug 2005 22:19:14 +0200
User-agent: Mutt/1.5.10i

Le Mon, Aug 22, 2005 at 04:46:43PM +0200, Ludovic Court?s écrivait/wrote:
> Dear GNU Lightning users,  ;-)
> 
> I'm wondering whether there exists a tool that can compile C (or a
> subset of C) to Lightning's assembly? 

If you mainly want to generate C code (either in source *.c files, or
in memory string) and then compile it, consider using TinyCC (assuming
you only target x86) see http://tinycc.org/ for more.

If you want to generate C like syntax, more suited to be generated,
consider using C-- (an intermediate language designed to be
generated). See http://www.cminusminus.org/

Lightning is not intended to parse any source code. You call lightning
macros to generate code sequentially. Any higher-level transformation
is up to you. You might for example generate some intermediate, nearly
executable, representation (either some kind of bytecode, like Parrot,
Ocaml, Lua, ... or some kind of abstract syntax tree), then code its
transformation to machine code using Lightning. In particular, GNU
smalltalk translate some bytecode to machine code using Lightning.


>  Such a tool would greatly help the implementations of
> code-generating functions.

Not necessarily, and this is not the way Lightning was
designed. Generating a concrete syntax (textual) representation is a
waste of developper and computer time.

BTW, is anyone working or interested (ia wanting) by a port of
Lightning to x86-64, ia AMD64 processor?

Regards

-- 
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]