Thursday, August 07, 2008

Static Compilation of IronPython Scripts

One of the headline features in the new IronPython 2.0 Beta 4 release is that static compilation is back. IronPython is actually a Python compiler, it compiles Python code to in memory assemblies (that can then be JITed like any other .NET assembly). In IronPython 1, these assemblies could be saved to disk (as .exe or .dll files) and then imported from like normal Python files. This was the IronPython equivalent of CPython's 'pyc' compiled bytecode files.

UPDATE: The new '' sample demonstrating static compilation for IronPython 2 is now available for download.

This feature is curently used by Resolver Systems to do binary only distributions of Resolver One. It was initially missing from IronPython 2, and for a while it looked like it wouldn't make it back again - but thankfully it has now returned. This makes the transition for Resolver One from IronPython 1 to IronPython 2 (once it out of beta) an easier one - although the Resolver One codebase is heavily optimised for IronPython 1 and the performance profile of IronPython 2 is quite different, so it will still involve a lot of work.

Srivatsn is on the dynamic language team as a tester, and he also manages some of the releases. In this blog entry he looks at the new static compilation feature; how to use it and what it does.
There is also an InfoQ article on the new IronPython release that focusses on the new compilation feature:

No comments:

Post a Comment

Note: only a member of this blog may post a comment.