Newbie: "compiling" scrips (?)

Christian Tismer tismer at tismer.com
Mon Jun 30 20:32:26 EDT 2003


holger krekel wrote:

> Alan Kennedy wrote:
> 
>>There are many pieces to what the PyPy people are trying to do, and they have a
>>lot of work to do building the separate pieces, with nothing to show until it's
>>all ready to fit nicely together. But I think their overall model looks
>>promising. So hopefully, with the description above, you'll be in a better
>>position to understand the content of these links.
>>
>>http://codespeak.net/moin/pypy/moin.cgi/PyPythonCore
>>http://codespeak.net/moin/pypy/moin.cgi/ObjectModel
>>http://codespeak.net/moin/pypy/moin.cgi/BytecodeCompiler
>>http://codespeak.net/moin/pypy/moin.cgi/BytecodeInterpreter
>>
>>For a look at the kinds of tricks that optimising interpreters can use, in the
>>java world, take a look over this link
>>
>>http://java.sun.com/products/hotspot/docs/whitepaper/Java_Hotspot_v1.4.1/Java_HSpot_WP_v1.4.1_1002_1.html
>>
>>Looking at the PyPy object model, I can't help but wonder how they're going to
>>deal with continuations? (If full integration of stackless is the intention).

Continuations, in the full sense of Stackless 1.0, are probably
not necessary, as they are not needed for CPython.

> The current idea is to implement "stackless" (or continuations) at the 
> code-generation level.  The idea is that instead of causing "interpreter-recursion" 
> when calling a function in python we setup a data structure and issue a "goto" 
> to the main-loop which then dispatches the next runnable frame.

To give you an update after the conversations on the sprint,
this is just one idea out of at least three.
I am going to study and implement them all.
PyPy gives us this opportunity. The bare chance to
just modify the code generator is tempting, but
pruning certain paths in the tree of possible
solutions too early is not in the sense of PyPy.

Besides the code generator, there are both the Stackless 1.0
and 2.0 approaches, which are valid solutions which can and
should be implemented for PyPy.
There is much more to it, to be discussed elsewhere.

> Doing this manually at the C-level (or Python-level for that matter) is
> tedious and error-prone.

Interesting. It seems that some people have more experience
with this stuff than I expected. I'd be glad to learn more...

- chris
-- 
Christian Tismer             :^)   <mailto:tismer at tismer.com>
Mission Impossible 5oftware  :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9a     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 89 09 53 34  home +49 30 802 86 56  pager +49 173 24 18 776
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
      whom do you want to sponsor today?   http://www.stackless.com/







More information about the Python-list mailing list