Release of PyPy 0.7.0

holger krekel hpk at trillke.net
Tue Aug 30 06:36:48 EDT 2005


Hi Valentino, Michael, all, 

On Sun, Aug 28, 2005 at 20:46 +0200, Valentino Volonghi aka Dialtone wrote:
> Michael Sparks <ms at cerenity.org> wrote:
> > Would it be useful for people to start trying out their modules/code to see
> > if they work with this release, and whether they can likewise be translated
> > using the C/LLVM backends, or would you say this is too early? (I'm more
> > thinking in terms of it providing real world usecases in the hope of
> > finding things that don't work - rather than anything else)
> 
> This is not how it works. Pypy doesn't translate your code to C/LLVM. 
> Currently PyPy can only translate a pretty simple subset of python
> called RPython which has a very C-like syntax (but without memory
> management code). This is needed to allow type inference inside the
> interpreter code.

This is mostly true but maybe a bit misleading.  The subset of Python 
that we can translate does not involve special syntax. For example
we can translate 

    http://codespeak.net/pypy/dist/pypy/translator/goal/richards.py

and gain some speed up by a factor of 70 over interpretation with 
CPython.  The "RPython" limitation mainly refers to the way 
how dynamically you use Python and how unambigously your values
flow across your functions and methods.  Also you cannot, for example, 
create classes dynamically while creating instances is, of course, 
no problem.  Also, we support all Python control flow statements. 
For a more detailed list, look at: 

    http://codespeak.net/pypy/dist/pypy/doc/coding-guide.html#rpython-definition-not

The real culprit is that we don't currently intend to try
offering a tool that can automatically translate Python
modules to C because we are still experimenting with and
targeting our own Python interpreter and tackling the
challenges that arise out of translating this efficiently. 
It's a matter of focus of the current dev group and not 
one of technical feasibility.  

If one or more people would want to care for producing,
testing and documenting such a tool on top of our current code
base then the next weeks might be good for that as we intend 
to go for some cleanup refactorings anyway. 

> The code in your application is application code and can be whatever you
> want, you may try to translate it to C/LLVM but it won't be that good of
> course because the annotator is not that intelligent.

See above.  You can try to translate python programs with a bit 
of effort and determination to find your way :-) 

> Just In Time compilation a-la-psyco is planned before the 1.0 release of
> pypy. 

We don't have a fixed version roadmap but indeed, we plan to work 
on JIT compilation and other niceties rather soon now. 

cheers, 

    holger



More information about the Python-list mailing list