Why not a Python compiler?

Stefan Behnel stefan_ml at behnel.de
Thu Feb 7 05:03:12 EST 2008


Santiago Romero wrote:
>  I'm impressed with python. I'm very happy with the language and I
> find Python+Pygame a very powerful and productive way of writing 2D
> games. I'm not, at this moment, worried about execution speed of the
> small game I'm working on (it runs at full 60 fps even in an old AMD-
> K6 450 Laptop computer), but I continue asking me the same question:
> 
>  Why not a Python COMPILER?
> 
>  It would be very nice to be able to output Linux, MAC or Windows
> binaries of compiled (not bytecompiled) code. It would run faster, it
> will be smaller in size (I think)

Take a look at Cython. It's an optimising Python-to-C compiler for writing
Python extensions. So you can basically take a Python module and compile it to
C code that runs against the CPython runtime.

http://cython.org/


> and it will be easy to distribute to
> people not having python installed. Yes, I know about py2exe, but I'm
> not sure if that's the right aproach.

That's a different focus, but then, there's "portable Python".

http://www.portablepython.com/

Stefan



More information about the Python-list mailing list