[pypy-dev] psyco in Python was: Minimal Python project

Christian Tismer tismer at tismer.com
Tue Jan 14 17:20:17 CET 2003

Edward K. Ream wrote:

> Also, it is not clear to me exactly how psyco in Python would work in the
> production version.  Clearly, it would be easy to do psyco in Python using
> the _present_ C implementation of Python, but how would psyco in Python be
> bootstrapped in an "all-Python" version?  At present, all Python code
> eventually gets executed as C code: either in the interpreter itself or in
> the C libraries.  In an "all-python version everything would get executed
> either as C code in the libraries, or assembly language output by Psycho.

Bootstrap is the magic word.

There will be a very tiny, portable little virtual
machine written in C. It is not meant to be efficient,
just enough to implement the bytecode interpreter.
I'm right now tinkering with parts of such a beast.
It is getting very small, just a few kilobytes executable.
This thing will be able to interpret Python bytecode.
So the only other thing we need is access to a file
with the marshalled implementation of the bytecode
If we have bytecode running, then we have Psyco (in
Python) running. Then, we already can produce
machine code for the tiny virtual engine.
Then we can load the real code generator for the
physical platform, if it is already existant,
and then Psyco generates code for that.

ciao - chris

More information about the Pypy-dev mailing list