first release of PyPy

beliavsky at aol.com beliavsky at aol.com
Sat May 21 06:56:24 EDT 2005


Shane Hathaway wrote:

<snip>

> > Please could somebody explain to us non-CS people why PyPy could
> > have speed features CPython can't have?
>
> The idea is to shift more of the responsibility to optimize code from
> the human to the computer.  Since C code is at a low level, the
computer
> can only infer low level intent and thus perform low level
> optimizations.  Humans optimize C by making thousands of
speed-oriented
> decisions directly in the code.  Python code is at a much higher
level,
> which should enable the computer to discover more of the programmer's
> intent and perform deep optimizations.
>
> In the end, the computer's automated optimization could turn out
better
> than a human's manual optimization.  Thus, by expressing the Python
> interpreter in a high level manner, PyPy is a first step toward deep
> optimizations that aren't possible to automate in C.

I am less optimistic but hope I am wrong :).

C++ is a higher level language than C, but it's not clear to me that
compilers are able to optimize C++ code using higher-level features
such as the Standard Library so that they run as fast as the equivalent
C code. OTOH, some C++ experts have advocated template metaprogramming
as a way of speeding up programs. I wonder how widely this technique is
used.

Fortran 95 is a considerably higher level language than Fortran 77, but
I get the impression from comp.lang.fortran that it is harder to
optimize. Fortran compilers compete in a performance-driven market, and
AFAIK they are written in C.




More information about the Python-list mailing list