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:
@staticmethod
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.

Comments

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 https://us.pycon.org/2018/registration/ 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…

PyCon Opens Financial Aid Applications

Even though PyCon prides itself on being an affordable conference, registration is one of several expenses an attendee must incur, and it’s likely the smallest one. Flying, whether halfway around the world or from a few hundred miles away, is more expensive. Staying in a hotel for a few days is also more expensive. All together, the cost of attending a conference can become prohibitively expensive. That’s where our Financial Aid program comes in. We’re opening applications for Financial Aid today, and we’ll be accepting them through February 15, 2018.
Once you have an account on the site, you can apply here or through your dashboard.
We offer need-based grants to enable people from across our community to attend PyCon. The criteria for evaluating requests takes into account several things, such as whether the applicant is a student, unemployed, or underemployed; their geographic location; and their involvement in both the conference and the greater Python community. Those presenting at …

Introducing the PyCon Hatchery Program

PyCon is known around the world as the Python community’s premier event, attracting people from 39 countries. Outside of the main track of talks, PyCon is home to a growing number of additional events such as Young Coders, the Education Summit, Language Summit, Poster Session, among others. The conference strives to be globally representative by promoting diversity and inclusion through these additional events and outreach programs.
Our community works to meet these goals year on year. In the past, we have received requests to add events to PyCon but have not had the resources to make them work. Although we are still limited on staff resources, we are proposing a stepping point that may lead us in the right direction. What is the end goal?We want to support our community and enable them to add events to PyCon that are important to our community. The long-term goals of this program are to support and grow sustainable events that will become a recurring part of PyCon itself or find a home…