Posts

Showing posts from May, 2009

Dynamic Languages at TechEd 2009

TechEd 2009 (Microsoft developer conference) is come and gone, but dynamic languages played a bigger part there than ever before and John Lam (IronRuby commander in chief) has blogged about his presentation. He has been working on interesting twists on the REPL; the Read-Eval-Print-Loop otherwise known as the interactive interpreter. He demonstrates one that can switch between DLR based languages (IronPython and IronRuby) and is an editor as well. The story for dynamic languages in Visual Studio is not massively impressive, but you can get good results with Wing or Netbeans , SharpDevelop has excellent IronPython support and there is also the editor built into the very interesting Pyjama Project . With the Microsoft dynamic languages team getting interested in editors perhaps the future is brighter for a supported Microsoft IDE for IronPython and IronRuby? Dynamic Languages at TechEd 2009 Dynamic languages on .NET are picking up momentum at this year's TechEd. Your typical Tec

Two Englishmen Named Tim Review IronPython in Action

In the last couple of weeks two Englishmen called Tim have posted reviews of IronPython in Action . Tim Anderson is a technical writer who specialises in writing about Microsoft technologies. As well as writing for the Guardian he blogs regularly and has just reviewed IronPython in Action: Book Review: IronPython in Action It is aimed at Python programmers who do not know .NET, and .NET programmers who do not know Python, rather than at existing IronPython developers. The authors run through the basics of Python and its .NET integration, so that by the end of Part 1 you could write a simple Windows Forms application. Part 2 is on core development techniques and covers duck typing, model-view-controller basics, handling XML, unit and functional testing, and metaprogramming – this is where you generate and execute code at runtime. It’s a well-written book and fulfils its purpose nicely. I like the way the book is honest about areas where IronPython is more verbose or awkward than C# or V

A Good Mix 7: JScript, Silverlight, Pyke and more

Another selection of IronPython and DLR related postings culled from the blogosphere in the last few weeks. Managed JScript (Bastard, red-headed step-child in the DLR) Managed JScript is an implementation of Javascript built on the Dynamic Language Runtime that shipped with Silverlight. It was touted as being useful for porting Javascript client-side code to work with Silverlight. It was only ever released in binary form and hasn't been maintained. In this blog entry the Frugal Coder laments the situation: I'm a Developer, I build Web Applications, and have for well over a decade now, and I love Javascript. I find the DLR compelling, and really want to see the Javascript implementation treated like a first class citizen. Give me code, samples and howtos. I'm going down this path anyhow, and would rather not do it alone. Running Pyke in IronPython Pyke is a very interesting looking Python project: " Pyke introduces a form of Logic Programming (inspired by Prolog) t

IronPython and the elmcity project: Together again

Jon Udell has been using Azure (Microsoft's cloud platform) for a calendar project he calls elmcity . Initially he tried to use IronPython, but the security settings of Azure (medium trust only) made this impossible. He proceeded with the project in C#, but Azure can now be used with a full-trust environment so IronPython is back on the table... IronPython and the elmcity project: Together again In the first installment of this elmcity+azure series my plan was to build an Azure-based calendar aggregator using IronPython. That turned out not to be possible at the time, because IronPython couldn’t run at full strength in Azure’s medium-trust environment. So I switched to C#, and have spent the past few months working in that language. It’s been a long while since I’ve worked intensively in a compiled and statically-typed language. But I love being contrarian. At a time when low ceremony languages are surging in popularity , I’m revisiting the realm of high ceremony. It’s been an

Python on the .NET Framework: There's more than one way to do it

IronPython is written in C# and is an implementation of the Python programming language that runs natively on the .NET framework with full access to .NET libraries. It isn't however the only way of using Python with .NET. One disadvantage of IronPython is that unless you are using Ironclad you can't use Python C extensions with IronPython, One alternative is Python.NET . This is a version of CPython (the normal implementation of Python) which also has integration with the .NET framework. As you would expect you can use Python C extensions with Python.NET, but when you use .NET objects you aren't using them natively but are using a proxied or copied version instead. There is also a little known third option: PyPy.NET . PyPy is an extremely interesting project - it is both an interpreter compiler toolchain, allowing you to write interpreters for dynamic languages in a high level static language called RPython which is a subset of Python, and a Python interpreter written in R

Using IronPython with Wing and Netbeans IDEs

Any good Python IDE will work well as an IronPython IDE, but some specific integration helps. One very good option is SharpDevelop, which has recently gained some very sophisticated IronPython support . My favourite Python IDE is Wing , particularly for its autocomplete (intellisense) for Python and how easy it is to extend with new tools through its scripting API. Unfortunately Wing doesn't know about .NET types and so doesn't provide autocomplete when using them through IronPython. It does have a mechanism for teaching it about new libraries (generating interface files) which I modified to work with .NET libraries. HOWTO: Using Wing with IronPython This article has the PI (Python Interface) script for downloads with instructions on how to generate PI files for .NET assemblies / namespaces plus how to make them available for Wing. It also has an example extension script for Wing which launches the current file with the IronPython interpreter (with instructions on how to make

Two New Releases: DLR 0.9.1 and IronPython 2.6 Beta ASP.NET Integration

To go with the four releases of IronPython and IronRuby are two more new releases: Dynamic Language Runtime 0.9.1 0.91 Release Notes A new source release of the DLR. This includes the Sympl sample language and can be built with Visual Studio 2008: This release has several design cleanups and final calls for the bits we’re shipping in CLR 4.0. This release is also consistent with Visual Studio’s Beta1 release in that these sources (with namespace tweaks) were used for parts of CLR 4.0. Documents have all been updated, and there is a new walkthrough document for an example language implementation on the DLR. The language, Sympl, has a C# and an IronPython implementation in the source tree, along with some example code written in Sympl. There are many one-off examples for Expression Trees node types that are in the DLR source tree now. ASP.NET Dynamic Languages Support Release Notes This is an updated release for using IronPython with ASP.NET and is compatible with the recent IronPython

Python, Jython and IronPython Performance

Robert Smallshire has been working on an implementation of BBC Basic written in IronPython . During development he has been disappointed with the performance of IronPython, in fact he discovered that some of his code was running massively slower than the same code on either CPython (the native implementation of Python) or Jython (the implementation for the Java Virtual Machine). He posted a series of blog entries on this where he dug deeper into the problem and eventually, with the help of the IronPython team he found a solution. I've listed the blog entries in the order they were posted; what follows is a story of performance, impressive charts and an explanation: Dismal Performance with IronPython Significant claims have been made about the performance of IronPython, notably back at its inception in 2004 when Jim Hugunin, creator of both IronPython and its cousin Jython, presented a paper on IronPython performance at PyCon. Since then, there have been numerous claims to IronPytho

The Dynamic Keyword in C# 4.0

The new dynamic keyword in C# 4.0 is made possible by including the Dynamic Language Runtime in the .NET framework. The DLR was originally part of the first implementation of IronPython and was abstracted out in order to create a framework for implementing dynamic languages on .NET. Further than that, the DLR has been used to introduce new features into C# and VB.NET, the static languages traditionally used to program .NET. This is seen as a major part of what is new in .NET 4.0. When Jim Hugunin went to work at Microsoft he wasn't employed to work specifically on IronPython; he joined the CLR (Common Language Runtime) architecture team with the brief of helping to make .NET a better runtime for dynamic languages. What follows is largely as the result of his influence and work. The full semantics of the dynamic keyword are laid out in the C# 4.0 language specification document. C# 4.0 Specification Document Note that this document is for the beta version of .NET 4.0. Although the

IronPython and IronRuby: Four New Releases

There have been four new releases of IronPython and IronRuby; two new ones for each project. The first pair of releases are for the CTP (Community Technology Preview) of .NET 4.0 Beta 1. Part of the Dynamic Language Runtime is included in .NET 4 and on top of this is built one of the major new features of C# 4.0 and VB.NET 10; the dynamic keyword. dynamic is a new static type and informs the compiler that operations on dynamic objects should be performed at runtime rather than bound at compile time. In particular this makes late bound COM and interacting with objects from DLR languages much more pleasant. It also enables true duck typing (in fact dynamic typing) in these traditionally statically compiled languages. To go alongside the .NET 4.0 CTP are new releases of IronPython and IronRuby, targetting the same version of the DLR included the CTP. IronRuby CTP for .NET 4.0 Beta 1 This is our second preview of IronRuby running under the Dynamic Language Runtime that is built directly in

Resolver One, Digipede, Timetric & Ironclad

Resolver One is the programmable .NET spreadsheet system created by Resolver Systems. It is of particular interest to this blog because it is written in IronPython and has the largest IronPython codebase in production. You may have heard me mention it here once or twice before. One of the advantages of Resolver One is how easy it is to integrate with other systems, whether they're .NET libraries or online services. We've recently worked with two companies and produced some demos of this in action. Resolver One and Digipede Resolver One and Digipede Sample Resolver One Goes Distributed on the Digipede Network Digipede is a distributed network computing platform for .NET. The coming version of Resolver One has changes allowing you to distribute spreadsheet tasks across a Digipede grid. If you have version 1.5 ( join the beta program here ) then you can use this sample to try it out. The Digipede Network is a brilliant way to get distributed, parallel computation on Windows. It

More IronPython Podcasts and Videos

Another collection of podcasts and videos on IronPython and the DLR, quite a few this time. Seven hours of screencasts on the DLR, IronPython and IronRuby for C# and VB.NET Developers These are all Microsoft videos and cover: Implementing a Dynamic Language Inside the Dynamic Language Runtime IronPython for the C# Developer IronPython for the Visual Basic .Net Developer IronRuby for the C# Developer IronRuby for the Visual Basic .Net Developer The Microsoft Dynamic Language Runtime Defined Harry Pierson (Microsoft IronPython PM) has recorded a new podcast with Deep Fried Bytes . He talked for so long they had to split it into two episodes! Episode 31: Being Dynamic about IronPython with Harry Pierson – Part 1 Episode 32: Being Dynamic about IronPython with Harry Pierson – Part 2 After a few months of hunting him down, Keith and Woody sat down with Harry Pierson who is a Program Manager on the Visual Studio languages team. Harry’s big passion is currently IronPython but he also works wi

IronPython in SharpDevelop 3.1 and Converting C# to IronPython

SharpDevelop is an open source Windows IDE for the .NET framework. MonoDevelop , the Mono IDE, started life as a fork of SharpDevelop. SharpDevelop lists amongst its features: Support for Mono Supported languages include C#, VB.NET, Boo, IronPython and F# IDE features like refactoring, code completion, Windows Forms designer Can run from a USB device Read only projects Parallel build support for multi-core machines Multi-framework targetting (.NET 2.0, 3.0 and 3.5) Integrated support for tools like FxCop, Wix, NUnit, TortoiseSVN, MSBuild etc One area where it distinguishes itself from Visual Studio, the 10 000 pound gorilla in the world of Windows IDEs, is its excellent support for IronPython. This just got a lot better in their latest release; 3.1 beta. Matt Ward, who I believe is responsible for the IronPython support, has written a couple of blog entries on the new features: IronPython 2.0 Forms Designer Support for designing Windows Forms in IronPython is now available in SharpDev

Getting Started with IronPython - Part 2: Let's write some code

A follow up from Part 1: where to start , this is a blog entry by Dror Helper on starting programming with IronPython. This entry mainly explores Python the language; including exceptions, classes, methods and magic methods. He has set himself the task of implementing a version of the Mancala board game . Getting Started with IronPython - Part 2: Let's write some code Playing Mancala is easy: The board has two stores (also called Mancala) one for each player and the goal of the game is to collect as many stones as possible. remark – if you don’t see the stores in the board above don’t worry my board doesn’t have any. instead I keep the seeds/stones won at the sides of the board . Each player has six pots he can play from (the ones closer to his side) in the board above my side is the six lower pots. Players alternate turns, in his turn a player choose one of his pots, takes all of the stones from that pot and places them one by one on every pot he passes in counter clockwise order.

A Good Mix 6: Databases, the DLR and Programming Languages

Another selection of blog entries and articles on IronPython culled from the last few weeks. FBConsole 0.8.2 Released I last reported on FBConsole in August 2007, when version 0.7.2 was released . FBConsole is a "Firebird RDBMS Tool Powered by IronPython" (a Python console for the Firebird database ). This new release ( via ) is built with IronPython 2.0. Configuring the DLR for IronPython and IronRuby Another blog entry in Japanese. It is useful though as it shows you the ScriptRuntime configuration ( app.config ) needed for hosting both IronPython and IronRuby in a single application. Useful if you are using the DLR to provide user scripting and want to give your users a choice of languages to use. Cobra Programming Language April Update Another update, with accompanying release , for the Cobra Programming Language . Cobra is a .NET programming language with both dynamic and static binding, a Python inspired syntax and first class support for unit tests and contracts. As

The Pyjama Project and PyjamaScheme

The Pyjama project is an open source sub-project run by the Institute for Personal Robots in Education , which is partly funded by Microsoft Research. The Pyjama Project The Pyjama Project is a framework for computing. At its core is an integrated editor and interactive console for writing and exploring computer science through dynamic languages. It is designed to be a simple, yet powerful, integrated development environment (IDE) for students, teachers, researchers, and regular humans, too. It runs on most any operating system, including Linux, Mac OS X, and Windows, and is built using .NET and Mono. All sources for the Pyjama Project are open and free---freely available and you are free to use them in various ways. All source code conforms to OSI approved licenses. Pyjama is built using the Dynamic Language Runtime (DLR) system from Microsoft. This means that languages (such as Python and Ruby) can share data and use a set of common libraries. For example, rather than writing a libra

An IronPython Presentation

Tarn Barford is another .NET developer interested in IronPython. He has just done a presentation for the Victoria .NET user group and the slides and his notes are on his blog: IronPython Presentation Python Basic information about the language and its background. Would have liked to have added meta programming or at least “...” to the paradigms. I think it’s a fantastic language so I’ll mention it’s expressive, fun, productive or whatever adjectives I’ve got in my head at the time. People using Python I really want to demonstrate that Python is real language, being used by real people, to write real code. I probably should also have mentioned Google App Engine here which I’ve been tinkering with a bit recently and think is pretty cool. IronPython The Python language on .Net. Most of the demo is doing cool stuff in .Net with the Python language. I think it goes further than this and allows developers to use their own paradigms and patterns to do .NET development. C# and IronPy

Getting a Jump Start with IronPython

Darrell Hawley is a Microsoft C# MVP and .NET developer with an interest in IronPython. He has written an article for Packt Publishing on getting started with IronPython: Getting a Jump Start with IronPython As a .NET developer, you’ve probably heard IronPython mentioned in a blog post or an article, but do you know what it is? IronPython is Microsoft’s implementation of the Python language. Python is known for readability and its’ proponents claim that applications written with Python are done faster, use fewer lines of code and are more maintainable than those written using more traditional languages. The great thing about IronPython is that you get the advantages of the language, while being able to leverage your knowledge of the .NET framework. In this article by Darrell Hawley, we will cover a few basic aspects of IronPython and use them to create a Windows Form. The article covers using IronPython from the command line and with a code editor like Scite, working with .NET regular

New Sample: Writing a DLR Language in C# or IronPython

As well as being the basis for language implementations like IronRuby and IronPython the Dynamic Language Runtime is intended to be a framework making it easy for YOU to implement a dynamic language that runs on .NET and Mono. So far there hasn't been a rush of languages using the DLR. The only ones I'm aware of are: IronScheme (at 1.0 Beta 3a released May 2nd 2009) Groovy DLR (at 1.0 Beta 4 released May 9th but may already be abandoned - see my previous blog entry ) Nua (Lua for the DLR) (no releases and last checkin July 2007 - so looks dead) DLR Basic (no releases and last checkin November 2008) IronSmalltalk (at version 0.1 with last checkin October 2008) IronLogo (at version 0.0.1 with last checkin January 2008) Managed JScript (Javascript) - developed by Microsoft and only ever released as Silverlight binaries. The future of Managed JScript is very unclear. Python, Ruby, Javascript (Managed JScript), Scheme, Groovy, Lua, Smalltalk, Basic and Logo would be an impre

Groovy: A New Language on the DLR?

There was an interesting new release on a codeplex project a few days ago: Groovy DLR 1.0 Beta 4 Released Groovy is an " agile dynamic language for the Java Virtual Machine ", with Java inspired syntax and capabilities but with additional dynamic features " inspired by languages like Python, Ruby and Smalltalk ". Groovy has a Rails inspired web framework called Grails and aims to be the " JVM's defacto dynamic language ", but faces stiff competition from both JRuby and Jython . So if Groovy is a JVM language, what is it doing on .NET and the Dynamic Language Runtime? Groovy DLR is the brainchild of Gavin Grover . His website says: Groovy/DLR Recently, Gavin Grover began adding the Groovy Language to Microsoft's dynamic language runtime . He's focusing on creating a full-featured syntactic skin using combinator parsers because that's what's most lacking in (J)Groovy. Groovy's syntax is the next generation in the C language famil