[ann] Minimal Python project

Christian Tismer tismer at tismer.de
Sun Jan 12 00:04:00 CET 2003

Paul Rubin wrote:
> "Edward K. Ream" <edream at tds.net> writes:
>>I am inclined to disbelieve this claim.  Why should Psycho be able to do
>>better than an optimizing C compiler applied to hand-written interpreter
>>code and/or library code?  The only possibilities I can think of:
>>1. The GIT somehow has access to enough run-time information to perform some
>>truly excellent optimizations.
>>2. The granularity of the data processed by the GIT somehow is big enough to
>>again affect some excellent optimizations.
>>3. There are other marvelous optimizations, unknown to me and available
>>neither to Guido nor to an optimizing compiler that can be applied.
> Fourth possibility: The CPython implementation, while highly flexible,
> is not especially fast, and a faster interpreter can be written by
> using different implementation techniques.  Also, it wasn't clear to
> me but perhaps Minimal Python will include a native-code compiler
> (Psyco-based or otherwise).

CPython is optimized towards portability, not speed.
The algorithms are clean and fast, but like every
implementation, it is written as one big compromize.
The C code base cannot adapt itself to changed
runtime demands.

With a generic approach like Psyco, there are
optimizations and specializations possible, where
a C programmer wouldn't even think of, or would
simply hesitate to implement, since this would
make the code so much harder to maintain.

For my planning (which is just where I'd like to
go, but maybe the group will decide otherwise),
there will be a native compiler version for every
platform, finally.
But I'm also thinking of a generic virtual machine,
modelled after Knuth's MMIX engne, which should
run on any platform.

> I've had the idea for a while that a "minimal" Python should actually
> include some language extensions to improve execution speed.  For
> example, being able to declare local variables and give type advice to
> the compiler (like Lisp systems do) can make it possible to early-bind
> class methods and slots to their callers.  That can avoid an awful lot
> of dictionary lookups and speeds things up considerably.

This is the very last thing I'm thinking of.
In the first place, I want to go as far as possible
with runtime deducible conclusions. When that
principle gets stuck, we should consider to
implement hints.

ciao - 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