[pypy-dev] CLI code generation (was: Svn account?)

Bert Freudenberg bert at impara.de
Mon Mar 20 14:51:29 CET 2006

Am 20.03.2006 um 14:39 schrieb holger krekel:

> Hi Armin, Antonio,
> On Mon, Mar 20, 2006 at 14:21 +0100, Armin Rigo wrote:
>> On Mon, Mar 20, 2006 at 10:52:42AM +0100, Antonio Cuni wrote:
>>> I think it should be fairly simple to translate from the SSA form  
>>> to a
>>> more "stack-friendly" form useful for stack-based machines; the  
>>> question
>>> is: where to put such code?
>>> Since it could be useful even for other backends, it would be  
>>> nice to
>>> put it in some place where it can be shared from several  
>>> backends: one
>>> option could be to write it as a backend optimization, but in  
>>> this case
>>> we have to introduce new low level operations for stack  
>>> manipulation,
>>> such as 'push', 'pop' or 'dup'.
>> Also useful for other back-ends would be a way to reconstruct some  
>> kind
>> of "expression tree".  For example, in Squeak, it is more  
>> efficient to
>> generate a single complex expression instead of a lot of simple
>> expressions, because of the shuffling of the local variables that the
>> latter requires.  The link with your suggestion is that these complex
>> expressions are also very stack-machine-friendly.
> Interesting but isn't the IL code a bit too low level for that to
> make full sense?
> For generating Squeak bytecode (or Python bytecode for that
> matter) it seems more obvious to me that generating (higher
> level) complex expressions is worthwhile.

No, you would want complex expressions if you generate *source* code.  
The *byte* code has to be one operation a time.

For Squeak there actually is a li'l compiler hack on my to-do list  
introducing gotos ;-)

- Bert -

More information about the Pypy-dev mailing list