python compiled to native in less than a year?

Paul Robinson paul.robinson at businesscollaborator.com
Thu Jan 18 13:21:17 EST 2001


Tim Roberts wrote:
> 
> "scotth" <slhath at flash.net> wrote:
> >
> > Whatever the problems, ActiveState/MS
> > have/are going to over come it if my info is correct.
> 
> Where did you get your information?  Do you have a URL?

http://www.activestate.com/Products/NET/index.html
 - there's a white paper (word doc) that has some interesting stuff in
it along with general discussion of both Perl .NET and Python .NET
 
> If I understand the .NET concept correctly, any COMPILED language will be
> compiled to IL.  However, I don't think there is anything to prevent a
> language from being interpreted.

If I understand what I've just read correctly (from URL above) then as
expected, "compiling" Python to the .NET IL does not suddenly give you
an instant speed boost or even give you something that is "as compiled"
as another language. As well as your Python program there is also the
Python runtime component of this .NET stuff. The architecture involves
the Python .NET runtime running the Python interpreter and spending its
time doing the basic language operations. As stated in the white paper: 

"Not withstanding the tuning of the runtime system, the simple existence
of the runtime accounts for much of our performance problem.  When
simple arithmetic expressions take hundreds or thousands of Intermediate
Language instructions (via the Python runtime) to complete, performance
will always be a struggle."

The IL compiler is described thus:
" - IL Compiler, which uses the Reflection::Emit() object model to
create managed assemblies. A significant part of the code generated by
the compiler consists of calls to the Python .NET Runtime."

So the compiler creates .NET IL which consists of calls to the Python
.NET runtime. This, IIRC, is similar to what Python2C does, Python -> C
with calls to C api.

The fact that there is a compiler that can, via .NET IL, compile Python
to native code does not necessarily mean that any kind of performance
boost is possible without additional technology (as discussed in the
white paper) such as type inference.

As the original poster said "this means that python will be compiled" -
yes - but in a way that includes the interpreter framework - necessary
for the dynamic nature of the language and not necessarily giving a
significant performance enhancement which I presume was what was meant
by "This would give python a huge boost!"

Don't get me wrong - I'm not trying to be overly negative but I wouldn't
want people to be disappointed with what Mark et al. are doing when they
should actually be excited and pleased. The inter operability of
different languages on this platform alone sounds really cool. - Maybe
I'm just trying managing my own expectations and erring on the side of
caution.....

Paul Robinson
Business Collaborator Development Manager
Enviros Software Solutions
WWW: http://www.businesscollaborator.com




More information about the Python-list mailing list