[Python-Dev] Python Specializing Compiler

Armin Rigo arigo@ulb.ac.be
Tue, 26 Jun 2001 22:01:54 -0400


I am considering using GNU Lightning to produce code from the Psyco
compiler. Has anyone already used it from a Python program ? If so, you
might already have done the necessary support module in C, and I might
be interested in it ! Otherwise, I'll start from scratch.

Of course, comments about whether I should use GNU Lightning at all, or
any other code-producing library (or even produce machine code "by
hand"), are welcome.

Also, I hope to be able to continue with more fundamental work on Psyco
very soon. One design decision I have to make now is about the way Psyco
reads Python code. Currently, it "reverse-engeneers" byte-code. Another
solution would be to compile from the source code (possibly with the
help of the 'Tools/Compiler/*' modules). The current solution, althought
not optimal, seems to make integration with the current interpreter
easier. Indeed, based on recent discussions, I now believe that a
realistic way to use Psyco would be to let the interpreter run normally
while doing some kind of profiling, and work on time-critical routines
only --- which at this point have already been compiled into byte-code
and executed at least a few times.