Monday, October 29, 2007

Accessing the .NET Field

Haibo Luo continues his series of posts on IronPython with information on accessing .NET class and instance fields with IronPython.

Sunday, October 28, 2007

IronPython 2, 'with' and COM

IronPython 2 targets Python 2.5, which means that the with statement is available. This is convenient because the currently released version of IronPython 2 there is a memory leak that keeps COM objects alive after they are used.

This bug is fixed in the IronPython source code control, but in the meantime a Japanese blogger has a workaround that uses 'with' and calls Marshal.ReleaseComObject - his fantastically nested example is for Excel Interop.
His blog has some other interesting IronPython stuff, including this example of Excel 2007 interop that creates a spreadsheet from a bitmap!

Friday, October 26, 2007

CPython Extensions for IronPython

Based on Python.NET I've got a proof of concept implementation for using CPython extensions from IronPython:
It has limitations, but the example code shows using matplotlib (with numpy and Tkinter) from IronPython 2.

EWeek Article: Microsoft's Growing Support for Dynamic Languages

An EWeek article on dynamic languages. The article is based on the presentation by Jim Hugunin at OOPSLA (Object-Oriented Programming, Systems, Languages and Applications).

Sunday, October 21, 2007

Dynamic Languages on .NET Video from Mix UK

The video of my talk from Mix UK is now available. See my blog entry for the link and talk description:

IronPython Support in SharpDevelop

The SharpDevelop community (specifically Matt Ward) has just announced IronPython support in SharpDevelop 2.2:
It looks pretty nifty, including intellisense and a Windows Forms designer. This is still in alpha and so is not included with SharpDevelop, but is a separate download from the blog entry.

Wednesday, October 17, 2007

Visual Studio as my IronPython Editor

Haibo Luo continues his series of posts on IronPython with instructions on how to setup Visual Studio 2005 & 2008 (currently in free beta) for use with IronPython, including intellisense, or even CPython!:

C Extensions for IronPython Mailing List

The new Resolver Systems project to allow IronPython to use CPython extensions now has a mailing list:

IronPython is now Open Source

The Microsoft license used for IronPython is now Open Source - or at least approved by the OSI. It is now called the Microsoft Public License:

Tuesday, October 16, 2007

Memory Savings with Magic Trampolines in Mono

Paolo describes the latest optimisations he has made in the Mono JIT compiler - and how this leads to memory savings for IronPython:

Monday, October 15, 2007

FePy 7 (IronPython Community Edition) Released

Seo Sanghyeon has just announced the release of FePy 7.

This is the first release of the IronPython Community Edition that includes IronPython 2 (specifically the recently released IronPython 2.0a5).

Seo is now working for Mozilla on the IronMonkey project, and this release was in part sponsored by Mozilla.

There are two projects that are part of FePy that are not included in this release.

Files under trunk/pyprof/, which tries to implement sys.setprofile with Mono profiler API. (Thanks to Miguel de Icaza and Paolo Molaro for help.)

Files under bench/, which benchmarks simple IronPython programs to measure progress of Mono runtime.

This release is built with Mono The minimum Mono version needed to compile and run for IronPython 1.x is 1.2.3. For IronPython 2.x it's 1.2.5. Mono 1.2.5 and are same except for ASP.NET bugfixes. DLR-based languages won't work with Mono versions before 1.2.5.

Changes in this release:


IronPython 2.0 Alpha 5.


dbapi module handles DBNull correctly. (Carsten Haese)
pyexpat module handles DTD. (Shozo Arai)


Following modules are now included: decimal, modulefinder, pkgutil, smtplib.
pystone benchmark. (It's under Lib/test.)

irclib, which works great. Try this example as a sanity test.


Patches are documented here.

New in this release:

For 1.x

For 2.x
patch-{325478,328022,333647} # Numbers refer to Mono bugs

Build system

Use NAnt to build IronPython 2.x.
Use quilt to manage patches.
Patches to build all IronPython 2 Alpha releases.
- AssemblyVersion.cs was missing in Alpha 3. (Miguel de Icaza)
Include both IronPython 1.x and 2.x, but share the library using

IronPython Cookbook Updates

There have been several new entries in the IronPython Cookbook since I last mentioned it. New material includes:
Plus various other new entries of course. If you haven't seen the cookbook before, it contains many examples of using .NET libraries from IronPython and also embedding IronPython into .NET applications.

Sunday, October 14, 2007

Dynamic Languages Support in Silverlight

An article on Ariel Nelson's blog, about dynamic languages in Silverlight, gives an introduction to using IronPython with Silverlight 1.1:

Saturday, October 13, 2007

IronPython 2.0 Alpha 5

There has been a new release of IronPython:
The main reason that IronPython 2 is still in alpha is that the Dynamic Language Runtime APIs change as it is extended / improved to better support the fledgeling IronRuby. It will need to be out of alpha by the time that Silverlight 1.1 final is released though!

This new version of IronPython fixes around 40 bugs / issues reported on Codeplex, plus 20 internally reported bugs. No major new features were added, but the 'array' module was ported from IronPython 1.1 to 2.0 in this release. (The bugs blocking my 'Python interactive interpreter in the browser' were fixed - so this should work with the next release of Silverlight.)

The source distribution should work with Visual Studio 2005 and 2008 (currently in free beta).

Python 2.5.2 is due for release soon as well...

Giles Thomas has also made an announcement on the Resolver blog: Open Source Project to get Some CPython Extensions Working with IronPython. This is a call for involvement (including advice) from the IronPython & Python community.

Friday, October 12, 2007

IronPython: Overloaded Methods

Haibo Luo's latest blog entry is about using .NET's overloaded methods from IronPython:

Thursday, October 11, 2007

Using C Extensions with IronPython: Resolver Announces Open Source Project

Resolver Systems has announced a new Open Source project, to get some essential CPython extensions working seamlessly with IronPython:

IronPython & Resolver at TechEd Barcelona

I'll be demonstrating Resolver at TechEd Barcelona, in a talk with Mahesh Prakriya and Martin Maly. IronPython will feature in several talks there:

VSX: Iron Cool Stuff

Alan Stevens looks at Visual Studio extensibility and is impressed with the IronPython examples:

Tuesday, October 09, 2007

More IronPython at Microsoft

Details of Visual Basic 10 are starting to emerge. This is a new version of Visual Basic that is slated to (at least optionally) replace VBA. Developers having been asking for more dynamic language features, so VB 10 will be built on the DLR.

Scott Guthrie and Scott Hanselman presented at the recent ALT.NET conference. They showed the new MVC version os ASP.NET - including the ability to create Controllers in IronPython and an IronPython view using a WebFormViewEngine. Demos of new technology from Microsoft always seem to involve illustrating the IronPython integration!

Want a job working on IronPython?
The Dynamic Language Runtime (DLR) team is expanding and is looking for a highly motivated and passionate engineer to join its test team. The DLR team is focused on delivering the most complete solutions around dynamic languages on .NET with respect to tools, libraries and community. Our main focal point is the DLR, which is a framework we’re building on top of the CLR to enable easy implementation of dynamic languages on .NET.

We’re looking for someone with a passion for dynamic languages to help us deliver the best experience in this space. As an SDET on the test team you’ll test our compiler implementations, contribute to our open source projects and help build our test automation and infrastructure.

dditionally, our test suites for IronRuby and IronPython must be flexible enough to ship to our open source community, without any ties to VSTS. The team is ripe with opportunities for growth and learning.

Saturday, October 06, 2007

IronPython 2 on Mono

Seo Sanghyeon has updated FePy to include a set of patches so that IronPython 2.0a4 will compile for Mono 1.2.5.
IronPython 2 is now an official part of the IronPython Community Edition.

Friday, October 05, 2007

Provide (or Not) Argument for By-ref Parameter

Haibo Luo continues delving into IronPython from a .NET point of view by looking at tuple unpacking, function return values and how to work with .NET 'by-reference' parameters from IronPython:

Max Recursion Limit in CPython and IronPython

Unlike CPython, a maximum recursion limit isn't set by default in IronPython. An exploration (and explanation):

Wednesday, October 03, 2007

Microsoft Opens up the .NET Class Libraries Source Code

Microsoft has just announced that it will be making the source code to a lot of the major .NET class libraries available. They will not be under an open source library, but it is still a big step.
Miguel de Icaza comments on what this does (and doesn't) mean for Mono. Mono is already distributing some Microsoft code (including IronPython...) that is available under their permissive license (which will soon be renamed the 'open' license - presumably in response to the OSIs request):

Python Keyword Arguments & .NET Arguments / Properties

Haibo Luo has done two more blog entries on IronPython, both about arguments and keyword arguments:
Using keyword arguments in .NET constructors to set properties (a nice feature of IronPython).
How different Python parameter passing styles map to .NET concepts.