Python compilers?

Jacek Generowicz jacek.generowicz at cern.ch
Tue May 18 07:41:43 EDT 2004


Leif K-Brooks <eurleif at ecritters.biz> writes:

> Svein Ove Aas wrote:
> > Is anyone working on a python-to-native compiler?
> > I'd be interested in taking a look.
> 
> What are you trying to achieve?
> 
> If it's faster code execution, the primary slowdown with a very
> high-level language like Python is caused by high-level data
> structures (introspection, everything being an object, etc.), not the
> code itself. A native compiler would still have to use high-level data
> structures to work with all Python code, so the speed increase
> wouldn't be very much.

Oh please !

Native compilers for other languages just as dynamic as Python
exist. These compilers manage to achieve very significant speed
increases[*]. 

Psyco is a native compiler, of sorts, for Python, and it manages to 
produce dramatic improvements (in the areas where it works).

While it's true that often speed doesn't matter, and many of the
criticisms levelled at Python for being too slow are completely
unfounded in real world situations, this is no reason for Pythonistas
to

a) be happy about the fact that Python is slow,

b) be convinced that Python _must_ be slow.

The sooner "we" stop believing that Python's flexibility comes at the
unavoidable cost of piss-poor runtime performance, and the sooner we
accept that it would be useful to have a Python which maintains its
flexibility but runs like a bat out of hell (ie, the sooner we stop
making excuses for Pythons lack of speed), the sooner we will get one.

Fortunately there is already a bunch of people who understand this,
and is trying to do something about it.


[*] A prime example is the Common Lisp implementation CMUCL. Ironically
    enough, CMUCL's compiler is called ... Python.



More information about the Python-list mailing list