lightning
[Top][All Lists]
Advanced

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

Re: [Lightning] Bytecode compiler


From: Paulo César Pereira de Andrade
Subject: Re: [Lightning] Bytecode compiler
Date: Fri, 3 Dec 2010 16:19:45 -0200

2010/12/3 Paolo Bonzini <address@hidden>:
> On Fri, Dec 3, 2010 at 10:36, Dok Sander <address@hidden> wrote:
>> Hi,
>>
>>  I haven't have any luck finding out about a compiler that generated GNU 
>> Lightning bytecode. I find this weird that there isn't a GCC version that 
>> would do this((like gcc-llvm) So, i'd like to know if such an project exists 
>> at all or is under development somewhere?
>
> GNU Lightning is more suited to creating JIT compilers via templates.
> So, it's a bit like programming in assembly language.
>
> Paulo Pereira has an interpreter for GNU lightning opcodes that (IIUC)
> compiles and runs the opcodes passed as input.

  I wrote a simple assembly like language, but it was intended
to be used a test suite for the changes I did in my patches in
http://github.com/pcpa/lightning
see http://github.com/pcpa/lightning/tree/master/contrib for the
source and the test cases.

  I hope to work again soon on extra code to possibly create an
intermediate representation, but currently I am working on code
to infer data types and value ranges for my language, so that it
can detect where it does not need to generate float opcodes,
where overflow is not possible, or when it does not need to
generate a fallback to runtime type check dispatch. One example
using a bytecode to lightning translation is:
http://code.google.com/p/exl/source/browse/trunk/lib/elightning.c
but maybe looking at gnu smalltalk translator would be easier to
understand (the above one is easy to me because I wrote it :-)
but it requires lightning from my tree in github).

> Paolo

Paulo



reply via email to

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