Friday, May 30, 2008

IronRuby runs Rails

John Lam has just announced that IronRuby runs Rails unmodified (the last hacking to get this far being done at RailsConf):
This is an important milestone for IronRuby as it means that it is compatible enough with the standard Ruby implementation to run large applications. There is still a lot of work to be done on performance, .NET integration and interoperability with other DLR languages.

It is also an important step for the Dynamic Language Runtime as there are now two major languages (plus Managed JScript) that run on top of it.

Chiron Updates for Dynamic Silverlight

Jimmy Schementi has released an updated version of 'Chiron' for "Dynamic Silverlight". Chiron is the development tool that packages Silverlight applications written in dynamic languages (IronPython and IronRuby).

As well as generating the 'xap' files for deployment, it will also package them dynamically running as a server - so you can test your dynamic apps from the filesystem without having to repackage them after every change.

The new update fixes the situation where Chiron wouldn't work with Firefox (when serving locally - and mainly on the Mac) because of an IPv4 / 6 binding issue.

Wednesday, May 28, 2008

Installing IronPython on Ubuntu

How hard is it to install IronPython on Ubuntu? How about:

sudo apt-get install ironpython

Monday, May 26, 2008

Catching Unhandled Exceptions in .NET

.NET provides two different APIs for handling two different types of 'program crashes'. The types of crashes both result in different dialogs; unhandled exceptions on the Windows Forms event loop are called "Thread Exceptions", and unhandled exceptions on a background thread are called "AppDomain Errors".  Menno finds his way through this confusion and shows how your program can exit gracefully in the event of either type of error:

Tuesday, May 20, 2008

Silverlight on Linux and Mood News Silverlight

The Mono effort to port Silverlight 2 to Linux is making good progress. Miguel de Icaza recently announced the first 'Hello World'  program running on Moonlight (the Silverlight 2 version):
Davy Mitchell has created a new version of his 'Mood News' program, it is written in IronPython and runs on Silverlight:

Ironclad 0.3 Released (Use CPython Extensions from IronPython)

William Reade of Resolver Systems has announced the release of Ironclad 0.3. Ironclad is a project to allow you to use CPython extensions from IronPython, and the improvement in this release is proper garbage collection for "managed objects of unmanaged types" (objects that come from a C extension!). This involves integrating the reference counting that the C extensions use with .NET garbage collection.

You can read about the project, and a high level overview of the new object lifetime management system on my blog:

Dynamic Script Control for WPF

Windows Presentation Foundation (the .NET user interface that is the successor to Windows Forms) and Silverlight support the definition of user interfaces with XAML (an XML markup language).  This includes using visual designer tools to generate the XAML.

You can create your own controls and then use them in XAML and the visual designer tools. Unfortunately this doesn't work for controls created with dynamic languages, because there is no static target for the XAML Loader to use when it encounters the corresponding XAML element.

Ivan Carrero (the author of "IronRuby in Action") has started a new project to create a 'Dynamic Script Control' (where the control is written in C# but initialised from code in IronPython or  IronRuby code specified in a XAML element attribute). I'll be assisting him with the IronPython support.

The Umbraco CMS with IronPython and Visual Studio

Umbraco is an open source .NET Content Management System based on ASP.NET. It supports IronPython and there is a Visual Studio plugin for Umbraco with IronPython support.

LOLCode and the Dynamic Language Runtime

A channel 8 video interview with Martin Maly (one of the DLR developers) on the Dynamic Language Runtime and his example language LOLCode:

FePy Update: IronPython 2.0 Beta 2 on Mono

Douglas Blank has done the work to get IronPython 2.0 Beta (the latest version of IronPython 2) working on Mono.

Monday, May 19, 2008

Invoking a SOAP Based Web Service with Powershell

In something of a mix of technologies, Kevin Hazzard explains how to use his 'ProxyForWsdl' project to invoke SOAP based webservices from Powershell. The relevance to IronPython is that the ProxyGen part of this project makes good use of IronPython in the test harness:

Matchmakers

Another blog entry from Martin Maly, unveiling the innards of the .NET Dynamic Language Runtime (astride which IronPython and IronRuby are lovingly crafted). Having covered the dynamic site caching mechanism for language operations (in previous posts), he moves onto an explanation of how the caches are searched, using "Matchmakers":

Sunday, May 18, 2008

Programming with Silverlight: Bugs and Missing Features

In the last week I've been writing the "IronPython in Action" chapter on Silverlight programming. It's mainly been great fun, but in the process I've come across a few bugs and quirks in Silverlight 2 (which is still in beta):

IronPython + VS2005 + Delete menu item

This is a very short blog entry, but if you use IronPython with Visual Studio 2005 then you might find it useful. It explains how to enable the context menu item "Delete" for IronPython projects.

The DevHawk World Tour 2008

Harry Pierson, the still-relatively-newish program manager for IronPython at Microsoft, is embarking on a world tour spreading the good news about IronPython. If you're in Amsterdam, New Zealand, Australia or Los Angeles in the next few months you may have a chance to meet up with him or hear him speak.

Alphabet Soup: A Survey of .NET Languages and Paradigms

"Alphabet Soup", an article by Joel Pobar, takes a look at some of the different languages and programming paradigms available on the .NET framework. Languages it covers include: C#, C++, F#, IronPython, IronRuby, and Visual Basic.

Friday, May 16, 2008

PyCon Italia Presentation Materials Online

Menno Smit has put the materials for his presentation on IronPython to PyCon Italy online (the materials are in English). This includes the S5 presentation, sample code and an example Resolver One spreadsheet:

Thursday, May 15, 2008

IronPython in Action: New chapters, website and sourcecode

Three new chapters (on WPF, ASP.NET and system administration) are now available in the IronPython in Action Early Access Program. There is now a new IronPython in Action website, where the sourcecode to accompany the book (well - the first eleven chapters so far) can be downloaded:

IronPython - Classes within separate files

Ben Hall comes to IronPython from 'traditional' .NET languages like C# and VB.NET, which have a different way of structuring applications into namespaces. In this blog entry he explores how Python uses files to arrange classes into modules:

IronPython for Printing from Second Life

Peter Quirk muses about whether he can solve the problem of not being able to print from within the Second Life environment by using realXtend, the scripting host for IronPython:

How I have fit IronPython, Ruby, JRuby and IronRuby into my existing .net projects

Chris Donnan blogs about how he uses the 'new' implementations of Python and Ruby into his existing .NET applications:

Friday, May 09, 2008

Accessing IronPython Objects from Javascript in the Winforms WebBrowser Control

Srivatsn has a blog entry showing how to expose IronPython objects to Javascript in the Windows Forms WebBrowser control.
This could be very useful combined with this technique for creating standalone desktop Silverlight applications.

Thursday, May 08, 2008

Debugging IronPython Code with Visual Studio

Harry Pierson has written up how to use Visual Studio to debug IronPython code:

Wednesday, May 07, 2008

Games Programming with IronPython and OpenTk

There are lots of good options for games programming with CPython, so it is nice to also have choices for IronPython. One .NET framework for games programming that boasts of working well with IronPython is "OpenTk".
The Open Toolkit is a game development library for .Net/Mono with an elegant, yet powerful, API. It enables you to bring your ideas to fruition, leveraging the full power of .Net, OpenGL and OpenAL.

OpenTK needs no setup. It runs on Linux and Windows and works with all .Net languages, like C#, VB.Net and IronPython. Best of all, it is - and will remain! - free for both commercial and non-commercial projects.

This is OpenGL like you've never seen it before.

Dynamic Silverlight Site Changes

Jimmy Schementi blogs about changes to the way that Dynamic Silverlight (the IronPython / IronRuby bits) are distributed. First, the distribution now includes Managed JScript, so you can get all your dynamic goodness in one tasty package. Second, the 'Dynamicsilverlight.net' domain has been hijacked by the marketing-droids and now redirects to a page on dynamic languages on the main Silverlight site. The canonical place to obtain the dynamic languages 'stuff' is now Dynamic Languages SDK on Codeplex.

Deserializing XML with IronPython

Having worked on stream processing XML with IronPython, Harry Pierson now turns his attention to deserialization. He choooses an interesting approach, dynamically creating classes to represent nodes:

Tuesday, May 06, 2008

Dynamic Client Script for ASP.NET and Silverlight 2b1

Dmitryr has updated his 'Dynamic Client Script' support for ASP.NET to work with Silverlight 2.0 Beta 1. This takes the code from 'Chiron' (the dynamic application development tool) and packages 'xap' files (dynamic Silverlight applications) dynamically from your IronPython / IronRuby / Managed JScript sources. It uses a custom ASP.NET tag:


Stream Processing XML in IronPython

Harry Pierson likes the xml.dom.pulldom API from the Python standard library, but it doesn't work with IronPython because it requires the pyexpat C extension module. (There is however an IronPython compatible version of pyexpat in FePy.)

In order to use a similar API, Harry has written a module called 'ipypulldom' that wraps .NET functionality:

Monday, May 05, 2008

Amazon SimpleDB with IronPython + Resolver One and IronPython in Action News

Several of my recent blog entries have been focussed on news about Resolver One, my book IronPython in Action, and using IronPython with the Amazon Web Services SimpleDB:
These posts also have links to new Resolver One screencasts (some showing how to use the features of Python within Resolver One spreadsheets), including the first of our screencasts posted to ShowMeDo.

The second screencast has also just been added to ShowMeDo:

Coding Geekette and the Cleveland Day of .NET

Sarah, the Coding Geekette, will be presenting a 200 level talk on IronPython at the Cleveland day of .NET on May 17th:
The talk abstract...

Intro to the IronPython Flying Circus
A 200 level presentation by Sarah Dutkiewicz

Come see taunts with an outrageous French accent, knights who say Ni,
Vikings who like Spam, and lumberjacks who like to press wildflowers as we
explore some basics behind IronPython, the .NET implementation of the
Python programming language.

A Front-end for an IronPython DSL

David Seruyange is experimenting with a windows forms front end for Twining, his IronPython DSL for working with databases:

Interesting Snippets

A few recent blog entries with fun snippets of IronPython code:

IronPython 2.0 Beta 2

There is a new version of IronPython 2.0 available - IP 2.0 Beta 2.
Highlights from this release (via DevHawk):

We’re pleased to announce the release of IronPython 2.0 Beta 2. In addition to the usual bug fixes (~25 reported on CodePlex and ~50 reported internally), this release has been partially focused on improving the performance of IronPython, in particular startup perf. Another focus of this release was improving upon our traceback support which had regressed quite a bit in 2.0B1 and had largely been broken in the 2.0 Alphas. Our traceback support should now be superior to that of IronPython 1.1!

We’ve also made a minor change to our packaging by adding a Microsoft.Scripting.Core.dll in addition to the Microsoft.Scripting.dll that’s been around since the start of 2.0. We are doing this purely as an architectural layering cleanup. Microsoft.Scripting.Core contains DLR features that are essential to building dynamic languages. Microsoft.Scripting will contain language implementation helpers that can either be re-used (e.g., BigInts) or copied (possibly e.g., the default binder). This process is all about our work to get the DLR architecture right and shouldn’t have any noticeable IronPython impact except that there’s now one more DLL to include in any package.


The Story of Ruby and Python in Silverlight

A great deal changed between Silverlight 1.1 alpha and Silverlight 2.0 beta 1. The changes were mainly for the better, but included very drastic changes to the way dynamic applications are packaged for Silverlight.

Jimmy Schementi has posted a very thorough (if slightly belated) explanation of why those changes were made, including explaining some of the details of packaging dynamic applications for Silverlight 2.0.

Error Reporting in Silverlight: Ruby and Python

Jimmy Schementi explains why creating Silverlight applications with dynamic languages is such a good experience, and the mechanisms available for detailed error reporting:

SAP DI Commander - an Interactive IronPython Environment

Python tools for working with the 'uber-enterprise' SAP, are not something I hear about very often, but this one is interesting and is based on IronPython.

DIC is an interactive environment for working with SAP Business 1 through the COM API:
There is a rather better introduction in the article where he introduced version 1 of DIC:
The introductory quote of that article explains why he wrote DIC:

If you have been involved with SAP Business One implementation projects, I'm sure you have at some point faced a situation where you needed to quickly modify a large amount of records in the customer's database. Here are some real-world examples from my past projects:
  • Change the default warehouse for 2,000 items in the database
  • Remove 4,000 items that were imported with an incorrect item number
  • Remove a few thousand items (from a total item count of 50,000) that have not been used in any transaction
  • Copy the account settings from one itemgroup to all the rest of the item groups (about 200 of them)

Being familiar with relational databases, I've pretty often found myself mumbling something like this:

"Dude, if they just would allow me to run a simple SQL update query in the database. This task would be completed in a few seconds."

Well, this is prohibited by SAP for rather obvious reasons. We need to get by with somewhat less powerful tools. (! *cough*)

On why the author chose Python:

I chose Python as the language of DIC because Python has a very clear, human-readable syntax and it also lets you interact with live objects as you build your code.