Archive for the ‘Events’ Category
Yesterday I was at TechDays 2010, where I presented a session on what’s new in VB 10 and C# 4.0. Before diving into the new features, I talked about the trends in language design and evolution – for those who are interested, I’d take a look at this session where Anders Hejlsberg goes into far more detail. Next I picked out a few personal highlights of what’s new in .NET 4.0 – including Code Contracts, Tuples and In-Process Side-By-Side Execution and talked briefly about co-evolution. The new VB features I talked about were Auto-implemented Properties, Implicit Line Continuation, Collection Initializers and Statement Lambdas. The new C# features I discussed were Optional and Named Parameters and Dynamically Typed Objects – of course no discussion of Dynamically Typed Objects would be complete without mentioning the Dynamic Language Runtime and I also talked about ExpandoObject and DynamicObject and how both C# and VB can use this new dynamic capability. The last two features are new to both C# and VB: Improved COM Interoperability and Co- and Contra-Variance.
Here are the links and references I used in my session:
I also referred to Ola Bini’s idea of fractal programming.
I suggested that there are two practical areas where experimentation with polyglot programming could be beneficial with existing applications and systems: extension and testing. By extension, I mean the ability to customise and add functionality – which is a great fit for a dynamic language like IronRuby or IronPython. Testing is also an area where dynamic languages have much to offer and I’d suggest taking a look at Ben Hall’s presentation that he gave at QCon earlier this year.
I spent yesterday on the Microsoft stand at QCon 2010. I took a few Iron Python samples with me to show to those who are interested. I wanted to be able to show three things: .NET runs Python, Python extends .NET and Python runs .NET.
.NET runs Python
To show that .NET can run Python I used the Text Processing sample I’ve blogged about before. I’ve subsequently added optparse to it so that it can be driven from the command line. The point of this sample is that it uses standard Python libraries, the whole application is written in Python (there’s a little XAML to describe the UI) and runs on the DLR courtesy of IronPython.
Python extends .NET
For a simple demonstration of extending a .NET application with Python, I took the sample application described here. This application allows the user to write Python (at runtime) that interacts with the application.
Python runs .NET
The last sample was an adaptation of the code here that reads a Twitter feed. Rather than use Twitter (with all the shortened urls and abbreviations) I decided to use an RSS feed from the BBC to create an Iron Python newsreader. The code is remarkably simple:
import clr clr.AddReference('System.Speech') clr.AddReference('System.Xml') from System.Speech.Synthesis import SpeechSynthesizer from System.Xml import XmlDocument, XmlTextReader xmlDoc = XmlDocument() xmlDoc.Load("http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml") spk = SpeechSynthesizer() itemsNode = xmlDoc.DocumentElement.SelectNodes("channel/item") for item in itemsNode: print item.SelectSingleNode("title").InnerText news = "<?xml version='1.0'?><speak version='1.0' xml:lang='en-GB'><break />" + item.SelectSingleNode("description").InnerText + "</speak>" spk.SpeakSsml(news)
This is Python using standard .NET libraries to show how a Python programmer has the .NET framework available to them through Iron Python.
As Matt announced, the slides from the Architect Insight Conference 2009 are all now online. The keynote videos are there too. As Marc notes, there’s something there for most architectural interests – including my session on Dynamic Languages and Architecture (with what could become my trademark use of translucent black.)
Thanks to all of you who attended my session at AIC earlier today. The slides will be made available on line over the next week or so.
I think the interesting capability made possible by the DLR is using static languages and dynamic languages together. And there’s another benefit of learning a new language: when we only use one language we tend to think in that language – having other languages in our toolkit means that we have other approaches available to us.
So, where can you start to take advantage of dynamic languages? The areas I discussed today were:
- extending your application by adding scripting support to your application
- configuring your application with a dynamic language
- creating a DSL using a dynamic language
- writing one or more layers of your architecture in a dynamic language
- testing your application(s) with a dynamic language
Of all of these, extending and testing are probably the best places to start.
I also talked a bit about the DLR (and a couple of the Iron Languages – Iron Python and Iron Ruby) and the way that C# will be taking advantage of the DLR. It’s fascinating to see the evolution of programming languages and how the trends of dynamic, functional and concurrent programming are influencing this evolution.
Here are the links that I gave out in my session:
•Dynamic Languages on .NET (www.microsoftpdc.com)
I also mentioned the Anders Hejlsberg session on the future of C# – you can watch that here – and a Channel 9 video of Anders Hejlsberg and Gilad Bracha discussing language design, which you can find here.
As part of the preparation for the session, I exchanged some emails with a few folks including Michael Foord. For those of you who’d like to see Michael’s take on this subject, he’s posted about it here.
This Friday the fourth annual Architect Insight Conference will roll into town – this year the town is London. I’ll be speaking about dynamic languages from an architectural perspective and how and when you can incorporate them into your architecture.
With a new week underway, I thought I should post my thoughts about Oredev 2008 last week. There was a real mix – of technology, people and sessions – that helped to create a great atmosphere. It was a large conference, but it never felt impersonal. The hospitality of our hosts (special thanks to the guys at Dotway) cannot be overstated. All added up to an enjoyable and useful week. Like Holmesy I find that Glenn’s post and Tim’s post match my reaction pretty well. I’d also suggest you take a look at this video for our view of Oredev.