Posts

IronPython Projects and Ironclad on Mono

There have been a few new projects using IronPython announced recently, plus Seo has been working on getting Ironclad to run on Mono. Ironclad Ironclad is a project to get Python C extensions working with IronPython. Although the project was created with a cross-platform implementation in mind, it is currently Windows only. Seo Sanghyeon has just posted the start of a patch for Mono compatibility to the Ironclad mailing list . He is hoping that the Mono port will pass the Ironclad test suite within a week. sysevlog.py More of a script than a project, but still cool. It receives Unix syslog packets and store them as Windows eventlog - in 44 lines of IronPython. Blog entry (Japanese) IronPython (2) Script mysecs Joseph Jude has started an IronPython project called 'mysecs' to track how much time he spends in different applications. It is a desktop and web web applications to " measure/analyse time spent in a day ": mysecs Google Code Homepage ryPDF Report Tools Ryan ...

Silverlight Dynamic Languages SDK 0.3 Released

Jimmy Schementi announced the third release of the Silverlight DLR SDK. This release works with Silverlight 2 Beta 2 and comes with the latest DLR, IronPython, IronRuby, and JScript binaries and sources. You can download it here .

adodbapi 2.2 ready for IronPython

Vernon Cole announced that with the release of adodbapi version 2.2, it will now run with either IronPython 2.0 or CPython. adodbapi makes it easy to use Microsoft ADO for connecting with databases and other data sources. You can get it at http://sourceforge.net/projects/adodbapi .

NVidia FX Composer 2.5: Scripted with IronPython

This is old news, but something that I've only just discovered. NVidia FX Composer 2.5 is scripted with IronPython. FX Composer 2.5 (Windows only I guess) is a " powerful integrated development environment for shader authoring ". The home page has screenshots and more details: NVidia FX Composer 2.5 GPU Shader Authoring Environment From the FX Composer User Guide (PDF) : " Scripting in FX Composer is typically accomplished using the Python scripting language. The implementation of Python used is IronPython 1 from Microsoft. IronPython supports all of the standard python syntax & library, with the additional advantage that it is implemented in a .NET language. This means that python scripting in FX Composer can call the rest of the FX Composer engine without additional work. It is important to note that none of the core functionality of FX Composer requires Python. The scripting is implemented entirely using a plugin (FXComposer.UI.Python), and in theory...

Measuring IronPython Performance Part III

Dave Fugate has written part 3 of his guide to measuring IronPython performance. In this entry he discusses things that can affect performance - not just different versions of .NET, but even security patches (!) can make a difference. Measuring IronPython Performance Part III Interestingly, due to practical limitations, the dynamic languages team only test on various configurations of Vista. This is despite the fact that, however much Microsoft wishes otherwise, most of their customers are still going to be using it with Windows XP... Vista comes with .NET 3 as standard - but IronPython itself only depends on .NET 2 (with Visual Studio 2008 you can set the version of .NET you are targeting when you compile). Specifically, IronPython 2 depends on .NET 2 SP1,which is actually more recent than .NET 3 - Service Pack 1 came out in November 2007. At Resolver Systems we are selling Resolver One into financial organisations, some of whom are technologically conservative, so it is possible tha...

IronPython on ASP.NET

A Zope programmer is attending an introduction to ASP.NET course. He does what any self-respecting Python programmer would do - and gets IronPython running with it. This blog entry creates a simple page using an 'aspx' view page, with the code behind in Python: python+zope++:: IronPython on ASP.NET

ADO.NET with IronPython for ASP.NET

The ARtyProg has posted an example of working with databases (specifically using ADO.NET) with IronPython and ASP.NET. The blog entry is little more than a big code example, but if you're looking for an example of ADO.NET or are getting started with ASP.NET for IronPython it should be useful: IronPython - ADO.NET It's good to see some blog entries of people using IronPython with ASP.NET (Christian has written a great chapter about it in IronPython in Action of course). Personally I feel ambivalent about ASP.NET. Its 'page-by-page' model seems to be fine for simple forms, but not a very good way of creating applications. ASP.NET MVC looks worlds better (Rails and Django even more so of course). On the other hand ASP.NET is massively used (possibly the most widely used web development framework), and people aren't going to switch over to ASP.NET MVC in any great proportion for probably years to come. If they're going to use ASP.NET then they might as well at lea...

RemLog: Back to Microsoft

Dave Remy blogs about his return to Microsoft - as lead program manager for the GO team (which includes languages like F# and IronPython). Back to Microsoft " I had an informal meeting with Drew and, what do you know, the Visual Studio Languages Unit has a team called the “Growth Opportunities” (GO) team that is responsible for IronRuby, IronPython and emerging languages. They needed a Lead Program Manager. I took the position and now I am working on a truly great team with folks like John Lam (the face of IronRuby), Harry Pierson (DevHawk blogger, IronPython PM), Jimmy Schmenti (Dynamic languages PM, wrote the Silverline plugin), Tomas Matousek (most awesome IronRuby developer), Dino Viehland (most awesome IronPython developer), Jim Deville (IronRuby QA), Curt Hagenlocher (both IronPython and IronRuby developer), Jim Hugunin (Dynamic Language Runtime and IronPython Architect), Bill Chiles (Dynamic Language Runtime Program Manager) and many, many more. " (Via DevHawk...

IronPython and Windows Workflow Foundation

Maurice de Beijer has a second example of embedding IronPython in VB.NET, this time with the goal of using it with Windows Workflow Foundation . Specifically he is using it with the workflow runtime services. Using an IronPython Runtime Service from Windows Workflow Foundation His examples are built on IronPython 2.0 Beta 4 and are available for download.

ViewModel Pattern extended with the Dynamic Language Runtime

Nikhil Kothari has been exploring design patterns for Silverlight applications. He ended up with verbose XAML and nearly recreating his own expression language. He solved this problem by embedding the Dynamic Language Runtime in his Silverlight application - with an ' InvokeScript ' action that he could use with a dynamic language (in his case managed JScript) to simplify his view-model pattern. ViewModel Pattern extended with the Dynamic Language Runtime " In my last post, I posted an implementation of the ViewModel or M-V-VM pattern for use in Silverlight applications. This pattern allows you to decouple your view presentation logic and data from the view, thereby facilitating independent development/design of your app as well as easier unit testing of your application code. " " I realized the Dynamic Language Runtime (DLR) would be a perfect fit. It is just the right designer-friendly glue that can be used to call into the bulk of the logic that is itself de...

Easy Install on IronPython

Jeff Hardy (the NSWGI and Django on IronPython) has been trying to get easy install running with IronPython (2 beta 4). easy_install on IronPython He includes instructions which will get you as far as easy install downloading an egg and then failing to decompress it because of an incomplete zlib implementation (using the partial implementation that comes with FePy ). " setuptools is a critical piece of the Python ecosystem: it extends distutils, but more importantly it provides easy_install, which is used by almost every Python library and application to handle installation. Making easy_install work in IronPython would make it far easier to download and install Python libraries. " " The good news is that it's not too hard to get going; there are only a couple of bugs that need to be worked around. The bad news is that it can't work with any of the files that are downloaded, as the zlib module is shot. " I wonder if zlib would work with Ironclad? The Bz2 mod...

Ironclad 0.5 Released - Use numpy from IronPython

Ironclad is an Open Source project created by Resolver Systems to allow you to use Python C extensions from IronPython. It is basically a reimplementation of the Python C API in C#. William Reade, the main developer of Ironclad, has just announced the release of version 0.5. Ironclad 0.5 Announcement Ironclad Project Homepage Download Ironclad Source and Windows Binaries Ironclad Mailing List The exciting thing is that with the latest release (and commenting out a single line in numpy) you can now import numpy from Ironpython and create and use integer arrays! There is still a lot of work to do, but this is great progress. From the announcement: Our original goal for 0.5 was to import numpy, from IronPython, and do something with it. With one monstrous caveat, we have reached that goal; the problem is that you need to comment out line 532 of numpy.core.numerictypes.py before it'll import. That line reads " _unicodesize = array('u','U1').itemsize ", and ...

Django on Jython, Python Implementations and Performance

Python is now in a very healthy position, with several major implementations: CPython, Jython, IronPython and PyPy. Python itself is very loosely specified (can anyone point me to the documentation for the __reversed__ method for example?). The specification is partly in the documentation and partly in CPython, which is called the 'reference implementation'. This blog entry is about the different implementations of Python, which parts of Python are specification and which are implementation details and what it means to talk about the performance of Python in the light of the different implementations. Django on Jython, Python Implementations and Performance UPDATE: It turns out that documentation for __reversed__ was added to the Python 2.6 docs in January. However it (currently) incorrectly states that it is new in 2.6 when it was in fact new in Python 2.4.

Introduction to XAML and WPF with IronPython : Part Four

After a long break Davy Mitchell continues his tutorial series on using WPF (the Windows Presentation Foundation UI library - new in .NET 3) from IronPython. This fourth entry creates a user interface with a stack panel, listbox and button. It creates the UI at runtime by reading in the XAML (an XML dialect for describing WPF UIs) and then hooking up the event handlers. Introduction to XAML and WPF with IronPython : Part Four Blog entry with links to all four parts of the tutorial " This article gives a bite size introduction to WPF (Windows Presentation Foundation) programming with IronPython. It is assumed you have a working knowledge of Python and can run IronPython programs from the command line. Please note that .Net 3.0 is required for WPF applications. "

Introducing IronPython: Code Magazine Article

Code Magazine has published an article on IronPython by the IronPython Program Manager: Harry Pierson. The article is an introduction to Python and IronPython, including the history of IronPython and some examples of Python. It is aimed at C# and VB.NET developers. Introducing IronPython Unfortunately the second page of the article is behind a paywall, but it looks like a great article if you have access. Some highlights. On block structure by indentation (lightweight syntax - nice): " Python’s significant whitespace is one of those things developers tend to either love or hate. However, the use of significant whitespace does appear to becoming more popular. Both Boo and Cobra, two open source .NET languages, use a Python-inspired syntax, including significant whitespace. Furthermore, Microsoft’s new F# language includes an optional lightweight syntax mode that makes indentation significant, just like Python. " On dynamic typing: " In any system of significant scale, the...

Dave's Ramblings: Dave Fugate on Testing IronPython Performance

Dave Fugate is a tester on the IronPython team. The IronPython team has recently done some great work on IronPython 2 performance improvements and Dave has started blogging on how they measure IronPython performance. His initial blog entry introduces himself and what he does (plus IronPython related topics he intends to blog about): Jumping back on the blogging bandwagon He has a two part blog entry on how they measure performance (the hardware infrastructure) and the results over time comparing 32bit to 64bit OSes. Every checkin triggers a benchmark run that takes over six hours (running a combination of PyBench, PyStone and custom microbenchmarks) on custom OS install. Measuring IronPython Performance Part 1 The second part compares performance (both PyStone and PyBench) for two identical machines - one running 32bit Vista and the other running 64bit Vista. Interestingly performance is worse for x64 architecture than it is for x86. Measuring IronPython Performance Part 2

IronPython 2 Integration in the SharpDevelop IDE

Matt Ward has integrated IronPython 2 Beta 4 into SharpDevelop 3. SharpDevelop is an open source IDE for .NET on Windows. As IronPython 2 has reduced Code DOM support, the Windows Forms designer and code conversion (C# / VB.NET to Python) is currently disabled. Using the forms designer to create forms in C# and then using them from IronPython is easy though. As IronPython 2 now supports static compilation, SharpDevelop can compile IronPython projects into executables or assemblies. SharpDevelop also has an IronPython console. IronPython 2 Beta 4 in SharpDevelop 3

DLR Hosting API : Dynamic Variable Lookup with Embedded IronPython

The IronPython (and Dynamic Language Runtime) hosting API has been designed from the beginning to make embedding IronPython into other applications easy. It has some interesting capabilities to this end. One of the basic classes in the hosting API is the ScriptScope . These represent module namespaces, and where name lookups from inside the Python engine are done. As well as creating and manipulating standard namespaces, they can be created with a 'backing store' that allows you to customize name lookup. The DLR Hosting API blog shows how to use this technique to chain scopes and create a 'pseudo heirarchy'. How to create ScriptScopes using backing symbol dictionaries to implement dynamic variable lookup The hosting API can be used from .NET languages like C# and VB.NET, but it can also be used from IronPython to customize code execution in a hosted engine.

ASP.NET: Dynamically Creating Objects and Binding them to a Form

A new post from the IronPython Resource blog on using IronPython with ASP.NET. This blog entry focusses on the easy creation of forms with data binding. The technique used is based on an article for C# that uses reflection. Of course with the introspection capabilities of Python, there is no need for the reflection. ASP.NET: Dynamically Creating Objects and Binding them to a Form The example project is available for download and is easy to extend.

Calling IronPython Functions from VB.NET

Maurice de Beijer is a VB.NET developer from the Netherlands. He has a particular interest in the Workflow Foundation and is interested in exploring it from IronPython. He has started his exploration by looking at creating Python functions and using them from VB.NET via the IronPython hosting API. As most examples of embedding IronPython are in C#, it is nice to see some examples in Visual Basic.NET. Calling IronPython Functions from VB.NET He shows several code examples and is using IronPython 2.0 Beta 3. His code creates a class from VB.NET and then imports this into Python code. The Python subclasses the VB.NET class, and he can then pull this class out of the IronPython execution scope because he knows what type it is. This is one of the ways of solving the 'type problem' when working with dynamic languages from statically typed languages like C# and VB.NET. Using dynamic operations exposed by the IronPython runtime you can then create instance of this Python class. It...