Friday, August 31, 2007

Mono 1.2.5 Released

Mono 1.2.5 has just been released. You can read the changelog here.

"This release fixes various issues that were exposed by IronPython 2.0 preview release and the Dynamic Language Runtime from Microsoft. They are both functional on this release."

Presumably this means that IronPython 2 (which is still in alpha) will now run on an unpactched Mono!

I also assume that the included version of IronPython is now 1.1 final rather than 1.1 alpha.

Other relevant changes:

Devirtualization optimization for sealed classes and methods, improving IronPython 2.0 pystone performance by 4%. Other programs can expect similar improvement [Rodrigo].

Invocation speed of non-multicast delegate methods has been increased by calling directly into the delegate, this improves IronPython 2.0 (pystone) performance by 25% [Zoltan Varga].

Math.Min and Math.Max are now inlined for signed integers and String.OrdinalCompare has been tuned to use these, which results in a 2-3% performance increase in running PyStone with IronPython.

Lots of other good stuff in there, including some support for the Mono implementation of Silverlight 1.1, Moonlight.

Wednesday, August 29, 2007

More Silverlight

A few more entries exploring Silverlight and IronPython:
If you serve Silverlight applications with IIS then this configuration guide may be helpful.

Manifold 8 - with IronPython Scripting

Manifold 8.00 has just been released. Included in the release highlights are 'IronPython Scripting'!

Manifold is a Geographic Information System package. Python has steadily been gaining ground as the standard scripting language for GIS applications.

Via Spatially Adjusted.

Tuesday, August 28, 2007

My First Look at DLR

Risman Adnan Mattotorang posts his exploration of the Dynamic Language Runtime:

My First Look at the DLR

In his previous entry he links to Nua, a fledgling project to implement Lua for .NET using the DLR.

Friday, August 24, 2007

Silverlight and IronPython

I've been doing some experimenting with Silverlight and IronPython. You will need Silverlight 1.1 Alpha Refresh to use these:
I have one more chapter to complete before IronPython in Action can go out to 'early access'. After that it is full steam ahead preparing for my two Silverlight talks...

IronLisp Benchmark Updated

The author of IronLisp has rerun his benchmark, running them as a program with IronPython rather than in the interactive interpreter. This means that the code is compiled by the DLR first.

This time IronLisp comes out twice as fast as IronPython, but IronPython is twice as fast as CPython:

Benchmarks Updated

Thursday, August 23, 2007

Handling POST with HttpListener and ProgressBar

There are two new recipes on the IronPython cookbook:

Tuesday, August 21, 2007

A New DLR Based .NET Language: IronLisp

There is a new member of the 'dynamic languages on .NET' family: IronLisp

The announcment is here:
It is built on top the Dynamic Language Runtime, which is at the heart of IronPython.

You can see a syntax example, including some benchmarks comparing against Python / IronPython / C# at: Benchmarks.

If you're interested in .NET languages, you may be interested in the Duck Typing Project. This is a library that implements duck typing for .NET, and is written in C#. The interesting thing is that it implements compile time duck typing rather than runtime.

From the website:

Duck typing is a principle of dynamic typing in which an object's current set of methods and properties determines the valid semantics, rather than its inheritance from a particular class.

The library handles a lot of casting between types that you would other wise have to do yourself, for example:

Casting a given object to a given interface that it does not implement by definition, but provides a compatible implementation of all its members. (This is done by dynamically generating a proxy type.)


Monday, August 20, 2007

Python.NET is Alive & Well

Python.NET is a project that hasn't had much publicity since IronPython became popular. Python.NET is a build of CPython with support for .NET, meaning that you can use .NET assemblies with ordinary Python (overcoming some of the limitations of IronPython - like the non-availability of C extensions).

There was recently an announcement (dated July 29th) about progress:

Good evening Python for .NET users!

I've a list of great news for you. In the past weeks I've spent some time in fixing and enhancing PythonNet.

  • PythonNet now works with Python 2.4 and 2.5. Python 2.6 compatibility is already prepared.
  • A bunch of small bugs were fixed and some new features implemented. Generics, overloading and variable parameter function should work better.
  • PythonNet also works under Un*x and Mono with UCS 2 and UCS 4 builds of Python. Two unit tests are currently failing.
  • The source repository contains project files for MS Visual Studio and MonoDevelop.
  • The clr module provides new features: AddReference, ListAssemblies(verbosity), preload
It sounds like Python.NET is alive and well...

Saturday, August 18, 2007

JVM Language Runtime (inspired by the DLR)

The DLR is at the heart of IronPython 2, and is a dynamic type system and language hosting system for .NET - abstracted out of IronPython 1. It makes creating dynamic languages for the CLR (the .NET VM) much easier and makes it possible for those languages to interact with each other (sharing a common type system).

Inspired by this, Charles Nutter (core developer of JRuby - Ruby for the Java VM) has started a similar project for the JVM:

JVM Language Runtime Project

This includes code and cooperation from the teams behind JRuby, Jython and Groovy - all prominent dynamic languages for 'Java-as-platform'.

Both JRuby and Jython are working heavily on their current implementations, but in the future both languages intend to use the 'JLR' to simplify and share their work.

Visio and IronPython

Two blog entries from Saveen Reddy, illustrating using IronPython with Microsoft Visio:

C# 3.0 as Python with Braces

A blog entry, by Saveen Reddy, comparing IronPython and C# 3.0 code side by side, using Notify Icon from the IronPython Cookbook as the example:

C# 3.0 as Python with Braces

Of course Python with braces isn't Python, but it could be worse...

Thursday, August 16, 2007

New and Updated Recipes in the Cookbook

There have been several new entries in the IronPython cookbook recently:

  • The IronPython 2 Parser - An example of using the IronPython 2 Parser API to extract the variable names used in a Python expression.
  • Screen Capture - Taking a screenshot from IronPython with Windows Forms.
  • Using Python Functions from C# - An example of embedding IronPython 2 in C# that creates IronPython functions and calls them from C#.
A while ago Andrzej Krzywda posted an example of downloading web pages with IronPython. It turns out that the examples can be made even shorter. See Accessing the Web with IronPython for details.

The IronPython Cookbook Downloading a Web Page recipe has been appropriately updated.

Silverlight Experimental 'Mini-Web-IDE'

I've posted an example IronPython Silverlight project - a mini web IDE that lets you enter and execute blocks of Python code in the browser. Read the description (or download the project) here:

About the Silverlight IronPython Web IDE

You can actually try it out here:

Silverlight IronPython Web IDE

This is useful as an example of an IronPython Silverlight project, but is also a useful tool for exploring the Silverlight assemblies.

How Badly will IronMonkey Hurt Performance?

'Someone' (couldn't find a name - sorry) posts a blog entry arguing that the implementation strategy for IronPython on Tamarin (IronMonkey) must be slow:

How Badly Will IronMonkey Hurt Performance?

Unsurprisingly, I'm not convinced:

My Response

In a further non-surprise, the original poster is not convinced by my response:

Perspective on Python Performance

Windows Forms Transparent Label

Davy Mitchell posts an improved version of his transparent label for Windows Forms:

IronPython - Transparent Label 2

Walkthrough of ASP.NET DataBinding with IronPython

A walkthrough of data binding in ASP.NET with IronPython:

DataBinding in ASP.NET with IronPython

ASP.NET with IronPython, Silverlight DLR Console Prototype

Ronan Geraghty has posted an example of using IronPython with Silverlight to create an ASP.NET site:

ASP.NET with IronPython, Silverlight DLR Console Prototype

Friday, August 10, 2007

IronPython in Visual Studio 2008 SDK

From the blog of Eric Lam, comes a post on the Visual Studio 2008 (what was codename Orcas), including these snippets:

2.1. Windows Presentation Framework (WPF) Designer Extensibility

The IronPython sample is enriched with Windows Presentation Framework (WPF) designer extensibility. This sample provides guidance for customers who want to extend Visual Studio to integrate their .NET based languages with XAML and WPF Designer, which are introduced in Visual Studio 2008. This sample is intended to showcase these extensibility points. The sample shows how to write a basic WPF application for a managed proprietary language by using IronPython as an example. The sample also illustrates how to handle events by using EventBindingProvider.

2.3. Expression Evaluator

Language integrators require an expression evaluator (EE) to work in the context of their programming language. We have created a new sample that shows how to write a basic EE for a managed proprietary language by using IronPython as an example.

Microsoft Visual Studio 2008 SDK August 2007

Wednesday, August 08, 2007

FbConsole 0.7.2 Release

There has been a fresh release of FbConsole, the "Firebird RDBMS Tool Powered by IronPython" (including a funky screenshot).

FbConsole 0.7.2

IronPython and CPython Sets

Flávio Codeço Coelho posts a performance comparison of IronPython and CPython sets.

CPython comes out a long way ahead, so more tuning needed for the IronPython set implementation:

Set Implementation Performance

Using Python Classes from .NET

IronPython classes aren't true .NET classes, not least because you can swap out their base classes dynamically, add methods and have all sorts of dynamic fun with them if you really want to.

There are ways to use IronPython classes from C# (and other .NET languages) though. This cookbook recipe shows one approach, which involves inheriting from a C# class:

Using Python Classes from .NET

Havana CMS

Lazy Coder reports his impressions working on Havana CMS in the past 2 months. Havana CMS is developed in C# 3.0 and IronPython.

Havana: Hybrid Programming

Saturday, August 04, 2007

A Web Based IDE for Distributed Programming (Part 2)

Mitch Barnett shows how far he has got with his web based distributed IDE for IronPython, and explains his plans for the future (including a release schedule as Open Source):

A Web Based IDE for Distributed Programming (Part 2)

DebuggerTypeProxy for IronPython Old Style Classes

Haibo Luo shows how to use the DebuggerTypeProxyAttribute to make debugging IronPython easier in Visual Studio:

DebuggerTypeProxy for IronPython Old Style Class and Instance

Thursday, August 02, 2007

IronPython, Visual Studio & WPF Designer

Aaron Marten explains how to get the IronPython integration sample working with Visual Studio with WPF Designer:

IronPython Integration Sample and the WPF Designer