Python compilers
Paul Rubin
phr-n2002a at nightsong.com
Wed Apr 3 01:08:36 EST 2002
Rob Hazlewood <rob at moofed.com> writes:
> Would I be right in saying that Python is an interpreted language?
Yes.
> I know it can be run as an interpreted language, however I seem to
> remember people talking about python compilers.
>
> Do Python compilers exist? are they efficient?
The current Python implmentations compile Python into either a
special-purpose byte code or into Java bytecode. The byte code is
then interpreted by an interpreter in C or by a JVM. There's an
experimental compiler called Psyco that makes machine code directly
and it runs a lot faster than interpreted Python bytecode, but it
doesn't implement the whole language. It's a promising direction
for development but not generally useable in its current form.
> If there is a python compiler, surely it would be able to generate
> code that is as efficient as a C compiler, resulting in what would be
> the best available OO language? (having simplicity, speed)
It can probably come pretty close, like Lisp compilers do, if you're
willing to accept some limitations on style.
> What is the performance of python like compared to other languages
> such as C and java?
Currently Python programs run a lot slower than C or Java, but that's
usually ok, since you can write them a lot faster than their C or Java
equivalents, and your time is more valuable than the computer's.
Faster Python implementations are always a desirable thing though.
More information about the Python-list
mailing list