unladen swallow: python and llvm

Stefan Behnel stefan_ml at behnel.de
Thu Jun 11 05:21:07 EDT 2009


Nick Craig-Wood wrote:
> Luis M  González wrote:
>>  I am very excited by this project (as well as by pypy) and I read all
>>  their plan, which looks quite practical and impressive.
>>  But I must confess that I can't understand why LLVM is so great for
>>  python and why it will make a difference.
> 
> CPython uses a C compiler to compile the python code (written in C)
> into native machine code.

That would be Cython: compile Python code to (optimised) C code and then
run a C compiler over that to get native machine code.

http://cython.org/

CPython compiles Python code to *byte-code* and then *interprets* that in a
virtual machine (which happens to be written in C, hence the name).

Stefan



More information about the Python-list mailing list