Directly Executable Files in Python

eryksun () eryksun at gmail.com
Wed Mar 30 08:35:31 EDT 2011


On Tuesday, March 29, 2011 3:51:30 AM UTC-4, Paul Rudin wrote:
> Benjamin Kaplan <benjami... at case.edu> writes:
> 
> > If you can figure out a good way to compile a language like Python,
> > you'll be very rich. Yes, it is running the interpreter and then
> > running the bytecode on the interpreter. It's the same way Java and
> > .NET work.
> 
> Not exactly AIUI. .NET bytecodes do actually get compiled to executable code
> before being executed (unless things have changed recently - I haven't
> really done anything significant with .NET in the last couple of years).

Java and languages in Microsoft's CLI (common language infrastructure) are statically typed, so it's not exactly a straight-forward comparison. 

IIRC, IronPython programs compile to a DLR (dynamic language runtime) AST (abstract source tree). This represents the program as runtime method calls and invoked DynamicSite objects. A site creates a caching delegate that checks the given argument types. As it encounters new combinations of argument types, it compiles the operation and updates the delegate.



More information about the Python-list mailing list