[ann] Minimal Python project

Peter Hansen peter at engcorp.com
Sat Jan 11 12:48:42 EST 2003


"Edward K. Ream" wrote:
> 
> > As Armin Rigo of PSYCO fame takes part in the effort,
> > we are confident that MinimalPython will eventually
> > run faster than today's CPython.
> 
> This announcement seems to be making a truly remarkable claim, namely that
> one could increase the speed of  C code by recoding it in Python and then
> applying Psycho to it.
> 
> 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:

I'm inclined to withhold judgment on such claims, admitting the
possibility that I don't know everything.

This inclination comes from an event in my distant past, around grade seven, 
when a friend of mine named Simon Gibson(*) and I were walking home from 
school one day and he told me that, with one of those new-fangled C 
compilers, it was possible to write code that ran *faster* than assembly 
language!  Pshaw!  What a load of hogwash, said I.  How could one possibly 
get code that ran faster assembly, the *fastest* language around, by 
writing it in a high-level language and having a compiler turn it into 
assembly!?  I was inclined to disbelieve the claim.

After a while, Simon convinced me that, with optimizations that I
as an assembly programmer would never make (at the time, it wasn't a
case of avoiding bad style, since one did anything one could to get fast
code, but simply a case of not thinking of the optimization trick),
a C compiler would indeed, someday, generate faster assembly than I could.  
I manage to get him to concede that an expert assembly programmer 
*might* then be able to tweak the resulting code, in special cases,
to be even faster, but I eventually accepted his claim.  And, of course,
eventually C compilers _were_ able to optimize and his point was proven.

Then there was the guy who said that no one would ever need more than
640K of RAM...

And then there was the HotSpot compiler for Java, which I was inclined
to disbelieve could ever produce faster code than those optimizing
C compilers.

I no longer believe it's wise to disbelieve claims so quickly...

I also think it *is* a good idea to express support for such novel
and pioneering efforts, when someone is willing to invest the time
needed to *try* to make it work, and willing to risk failure.  
Those of us willing to sit on the sidelines should be supportive, IMHO.

-Peter

(*) Simon was, sadly, killed in a climbing accident during a co-op
work-term at Microsoft. (Another thing I've never forgiven them for. ;-)




More information about the Python-list mailing list