[pypy-dev] Re: gnu lightning

Armin Rigo arigo at tunes.org
Fri Oct 10 14:26:21 CEST 2003


On Fri, Oct 10, 2003 at 02:09:02PM +0200, Samuele Pedroni wrote:
> >> just stumbled across the gnu lightning project
> >
> >I know Armin knows about this and doesn't (didn't?) consider it
> >suitable for psyco, but I must admit I don't remember why.
> Obviously Armin can/will answer himself. If I recollect correctly it was 
> something about Psyco emitting fragments at a time instead of whole
> functions (?)

Yes, this was the main reason: GNU Lightning and most other similar libraries
are oriented around the concept of function. They are unsuitable for Psyco
because I really need fragments. (The licensing issue was another problem with
GNU Lightning.)

For PyPy the situation might be a bit different. I am sure there are use cases
in which we'd like to emit code a bit faster than by calling an external C
compiler, but still don't need essentially finer-grained control. The problem
might still be that we'll probably need compiler-like optimizations before we
can emit good machine code, and GNU Lightning doesn't provide that.

Actually I think that writing machine code won't be the most difficult
problem. It should be a nice exercice to design a declarative way to describe
instruction encodings in Python. Then we can have an assembler, a
disassembler, and more for free. I've actually experimented with something
like that in an earlier attempt at Psyco. (XXX link)


More information about the Pypy-dev mailing list