The Coding Weasel

Tuesday, December 12, 2006

some more on IronPython

Michael Foord has some notes on getting IronKant working with IronPython on Windows here

During my talk, I showed a slide that IronPython on .Net runs pybench at 41% of CPython 2.5's speed (71%, if you exclude the TryRaiseExcept case, where it totally loses), while Mono 1.1.17 gets around 14% of of CPython 2.5's speed. I finally got around to trying Mono 1.2.2 (I didn't have time before the talk). It's actually about 12% _slower_ than 1.1.17. This makes me sad. Very sad. I need to get pybench checked into IPCE and point the Mono and .Net folks at it.

It's pretty obvious that both .Net and Mono optimised for pystone - in both cases, IronPython is more than 20% faster than CPython. Unfortunately, pystones is a terrible benchmark. If they can optimise for pybench, most people's applications will see a real improvement.

Labels: , ,

Monday, December 11, 2006

talk #2: futurepython

The final talk from the three I did at OSDC is up now. This was the end of day talk on Thursday, "futurepython". I talked about IronPython and Python 3.0. Unlike the other two talks, this one wasn't done using Bruce. Instead, I did an extremely quick port of Bruce to run on top of IronPython and SdlDotNet. In keeping with the philosopher's naming scheme of Bruce, I called it "ironkant".

The talk is here, including the ironkant code. I should point out that ironkant almost certainly has bugs - I started it late Wednesday night after the conference dinner and finished it (and the talk) a good 5 minutes before I presented it the next afternoon. What can I say, I just thrive on the stress. Having the presentation running on top of IronPython was a pretty good demonstration of just how far along IronPython has come.

And sorry Jim for calling you a crazy man - I mean that with love and respect :-)

I was extremely impressed with how easy it is to grab a C# assembly, read the C# docs and get coding. I also only had to make one fix to a CPython standard library module to get the code to work - in this case, I had to fix codeop.py to not pass the DONT_IMPLY_DEDENT flag to the builtin compile() method. This flag is both undocumented and implemented in codeop.py in a most foul way - I've opened Python bug 1612012 about it. The fixed version of codeop.py is now in the SVN version of IPCE.

I started porting popen2 as well, that's not finished yet (but will be this week). For the moment, I'm just using os.spawnl() directly inside IronKant for spawning external programs.

The longer Windows.Forms example in the talk is from Michael Foord's excellent tutorial on the subject. If you're at all interested in producing native GUIs on both Windows and Unix, you should definitely check the tutorial out. And buy his book about IronPython when it's done!

Labels: , ,