IronPython


At PyCon (a conference for Python developers) last week, Microsoft made an announcement regarding the project code named IronPython. Python is an open source dynamic language – for non-developers like me – dynamic languages enable developers to produce applications more efficiently by reducing the amount of complexity in the code they write by relying heavily on the capabilities of underlying runtime. Traditionally, the trade-off has been related to performance but as both the languages and runtime technologies mature these issues are being addressed. Microsoft’s IronPython project demonstrates the benefits of putting the Python dynamic language on the .NET Common Language Runtime. 

 

Jim Hugunin, a Software Design Engineer on the Common Language Runtime (CLR) team and the creator of IronPython has released IronPython 0.7 under a Shared Source license.

 

Here are the benefits of IronPython as given to me by Jim.

  • Integrated with the .NET Framework – IronPython code can easily use .NET libraries also, Python classes can extend .NET classes.
  • Fully dynamic – IronPython supports an interactive interpreter and transparent on-the-fly compilation of source files just like standard Python.
  • Fast – IronPython 0.7 is up to 1.8x faster than Python-2.4 on the standard pystone benchmark. The key to IronPython’s performance is that it compiles Python code to .NET Intermediary Language which is then translated to optimized machine code by the runtime.
  • Managed and verifiable – IronPython generates verifiable assemblies with no dependencies on native libraries that can run in environments which require verifiable managed code.

 

The license we are using for this release is based on the BSD model of licensing. We worked hard to keep this license short and straight-forward. Like all BSD derivative licenses, this one gives the right to modify and redistribute the code commercially. There are no mandatory reciprocal terms – it is a permissive license.

 

Now that the project has been released in the 0.7 form, Jim is talking about significantly stepping up the pace and engaging deeply with the community. I’m looking forward to watching this project progress.

 

This posting is provided “AS IS” with no warranties, and confers no rights.

Comments (8)

  1. C++ Guy says:

    What happens in IronPython and the following line:

    s = open("mytext.txt", "rt’).read()

    Is the file handle left open to be cleaned up sometime by the .Net fremework?

  2. Sriram says:

    Lots of people in the IronPython community are raising questions over the license. See the last comment on your ‘More than Windows’ post for one such sample. Unfortunately, Jim hasn’t been able to respond to these questions yet

  3. Swaroop C H says:

    To C++ guy, yes, it will be cleaned up the .Net framework since it has garbage collection.

  4. Swaroop C H says:

    I would like to explicitly ask whether Mono and DotGNU can bundle IronPython without hindrance?

  5. C++ guy says:

    Sorry, should have rephrased my question as "When will it be cleaned up?"

    I generally use Python over other languages because its garbage collection is deterministic in the simple case. If the file handle isn’t immediately released in my example, then I don’t think I’ll be switching to IronPython.

  6. Angry Reader says:

    C++ guy:

    A little of blog nettiquette: This posting is not about the specifics and/or implementations of IronPython. Don’t be Troll.

  7. to C++ guy says:

    It will eventually behave exactly like python if it does not already. If python closes it immediately, ironpython will. We talked about autodisposing the file stream in boo, too: http://archive.boo.codehaus.org/dev/threads/ldpecoeamaknfiellfag

  8. to C++ guy says:

    I was wrong, the file won’t be guaranteed to be closed because IronPython, like Jython, doesn’t use reference counting like CPython does. See http://listserver.dreamhost.com/pipermail/users-ironpython.com/2005-March/000354.html