Python compilers?

simo simoninusa2001 at yahoo.co.uk
Tue May 18 12:48:52 EDT 2004


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

> > Is anyone working on a python-to-native compiler?
> > I'd be interested in taking a look.
 
> 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.

I think the main slowdown most people would see is the startup time -
the interpreter takes way too long to start (why the company where I
work won't replace Perl/PHP with Python).

> If it's ease of distribution you're looking for, I think distutils can 
> make standalone programs on Windows, and most Linux distros have Python 
> installed by default.

Oh that one is funny - do most distro's have PyQT and wxPython (and
their supporting Qt/GKT libs) installed by default, oh and which ones
come with 2.3 by default?

> If you just think a compiler would be cool (or would like to see how it 
> would be done), check out Psyco, Pyrex, and probably some other 
> projects. Pyrex even combats the speed issue by allowing native C types 
> to be used in addition to Python high-level types.

I thought Pyrex was a hybrid of C and Python (like Jython/Java) not
actually a Python-to-C convertor? And Pysco is just a different VM
isn't it?

I could really push Python where I work if there was a native
compiler, my company uses C/C++/Java/Qt and were looking at QSA as a
way to allow the user to script things, but as all of our products
integrate with our software protection system, we can't be
distributing source or easily decompiled bytecode!

We could replace the whole lot with PyQt and use an embedded Python
interpreter for the scripting! Ah the frustration :-(



More information about the Python-list mailing list