Skip to main content

IronPython keynote

The news from this morning's keynote is: IronPython released (at last). The running joke in Jim Hugunin's talk was pretending that it had only been two months since he joined Microsoft. In fact, it took about eight months to work out how to do an open source release once he got to Microsoft.

The new plan is to release every two weeks until there is a 1.0 release. There are one-and-a-half engineers working on IronPython. Jim is spending half his time evangelizing dynamic languages and Python within Microsoft. The hope is that the next version of CLR will have better support for dynamic languages (although it's not at all clear to me what that means).

The talk was basically the same as the talk he gave at Lightweight Languages in December, but stretched out to an hour. There was time for more demos and more technical detail.

Jim claims two advantages for Python running on .NET: It provides easy access to .NET libraries, and it leverages a substantial engineering effort on the .NET VM. He showed his standard demo using msagent. The demo crashed: "Look at this beautiful stack trace." He has used this demo to introduce people to Python, like C# programmers. The interactive interpreter has left the biggest impression on people.

On the other hand, he has seen C# programmers write this as their first Python program:
 from System import *

class C:
def Main():
Console.Out.Writeln("Hello, World!")

He also had a demo of an Avalon GUI in Python. The basic demo was
trivial -- window, title, button. Jim was droll: "Doesn't that make you drool?
Don't you want to lick my screen?" He showed a xaml-generated GUI and
wrote some code to walk over the GUI objects -- basic introspection
and modification of individual widgets.

By relying on the .NET VM allows the IronPython implementation to stay
simple. IP 0.7 is about 80% faster than Python 2.4. The IP
implementation doesn't make any particular effort at optimization. It
has a straightforward code generator. From the bytecode, it looks
very much like Jython: use static fields in generator code for
constants, call into runtime implemented in C# for most real
operations -- "==" op calls "IronPython...Ops::Equal".

Guido asked: The generated x86 is somewhat larger than the Python bytecode.
Does the increased size cause worse cache performance? more misses
when you run the larger code?

Jim's answer: Based on experimental evidence, this isn't a problem. Memory
pressure is an issue in general, but he doesn't have any evidence that code size is the problem. The current IP implementation uses a lot more memory than CPython.

The next demo was loading a C# assembly into IP and calling a static method. The audience asked him to call a Python function from C#. He was entertainingly nervous about getting this part of the demo to work. He got a big round of applause when the demo worked. He passed a Python function into C# and had it called.

Next showed the debugger integration. The debugger shows a mix of IP implementation code and Python code. You can introspect on values in either language. The profiler works the same way, he said.

The standard for long-term compatibility is Jython. IP ought to run the same set of regression tests as Jython.

Some of the hard integration problems:
  • Can all strings by unicode? (Guido: Fine with me.)
  • What is the right locking policy? There's no GIL in IP, so what kind of concurrency should the builtin types allow.
  • Can we experiment with optional static types?
  • How to expose CLR-style methods on both Python types and on existing CLR types? For example, should a CLR ArrayList have an append() method like Python?
I asked Jim about the key differences between IronPython and Jython. The basic architecture of the two systems is the same, and his original IP talk looks at lot like his original JPython talk. I was standing at the microphone, so I didn't write down all the things he mentioned. There are a lot of differences that result from having C# instead of Java as the implementation language: Delegates (C#'s typed function pointers) make it easier to call between Python and C#. The generics support in the VM allows him to introspect on generic types and provide straightforward mappings to Python types; in Java, there is no way to recover the original generic types at runtime. Can't recall what else he said; I'll have to ask again.


Will Robinson said…
This comment has been removed by a blog administrator.
Jeremy Hylton said…
The first time I saw the talk I was most impressed with the integrated debugger support. Jim did a more substantial demo of that feature at LL4.

Popular posts from this blog

PyCon 2018 Registration is Now Open!

We’re thrilled to announce the opening of registration for PyCon 2018 in Cleveland, Ohio! The prior six PyCons have sold out, so prepare for another one and get your tickets early. The first 800 tickets sold are priced at an early bird discount, saving over 20% on corporate tickets and over 12% on individual tickets. Students save $25 if they purchase early!

To get started, create an account and head to to get your tickets!

You get a package that is hard to beat when you register for PyCon. The conference itself is three days worth of our community’s 95 best talks, amazing keynote speakers each morning, and our famed lightning talks to close out each day, but it’s much more than that. It’s having over 3,000 people in one place to learn from and share with. It’s joining a conversation in the hallway with the creators of open source projects. It’s taking yourself from beginner to intermediate, or intermediate to advanced. For some, it’s getting st…

Python Education Summit celebrates its 6th year in 2018

Teachers, educators, and Python users: come and share your projects, experiences, and tools of the trade you use to teach coding and Python to your students. The Annual Python Education Summit is held in conjunction with PyCon 2018, taking place on Thursday May 10. Our Call for Proposals is open until January 3rd, and we want to hear from you! See for more details.

What we look for in Education Summit talks are ideas, experiences, and best practices on how teachers and programmers have implemented instruction in their schools, communities, books, tutorials, and other places of learning by using Python.

Have you implemented a program that you've been dying to talk about?Have you tried something that failed but learned some great lessons that you can share?Have you been successful implementing a particular program?
We urge anyone in this space to submit a talk! We’re looking for people who want to share their knowledge and leverage…

How to get ready for the PyCon development sprints

[A guest post by Kushal Das, one of the 2016 Sprint Coordinators]So — you have already decided to join in the PyCon development sprints! The sprints run for four days, from Thursday to Sunday after the conference. You do not have to be registered for the conference to attend the sprints! Some teams plan to write code over all four days, while some projects plan a shorter sprint if the organizers cannot stay for all four days.Can you start getting prepared for the sprint ahead of time? Yes!There are several things you can do ahead of time, that can save effort once you arrive at the sprints — and some preparations can even be made at home, before you arrive at PyCon:Have your operating system updated and patched — whether Mac, Windows, or Linux. This eliminates one possible source of problems with getting software up and running.Go ahead and install the version control system that will be used by the projects you are interested in. If you install both git and Mercurial on your computer…