Compiling

bruno at modulix onurb at xiludom.gro
Fri Feb 3 12:47:04 EST 2006


Simon Faulkner wrote:
>>> I love Python for it's ease and speed of development especially for the
>>> "Programming Challenged" like me but why hasn't someone written a
>>> compiler for Python?
>>
>>
>>
>> But there *is* a compiler for Python.
>> http://www.python.org/doc/2.4.2/lib/module-compiler.html
> 
> 
> ty Bruno, I must confes that I don't understand much of that chapter!
> 
> I will work harder... :-)
> 

Hint : You probably don't need to understand anything in this chapter.
This compiler compiles Python source code to Python bytecode, which is
then executed by the Python interpreter. You may not have noticed -
since the Python interpreter is smart enough to call the compiler when
needed - but Python is compiled to bytecode before execution. Just look
at all the .pyc files on your filesystem.

For short : this was kind of a joke... I understand that what you were
looking for is a 'native code' compiler. AFAIK, this could of course be
done, but due to Python's very dynamic nature, it's not sure this would
lead to drastically better performances.

HTH
-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list