DLR Delight

Just occasionally, Microsoft produces something so radical and neat that you can’t help but gasp in amazement at the implications. How on earth did that happen? So it has been with the Dynamic Language Runtime.

The .NET Framework has been a solid and workmanlike product, but it has been deliberately conservative: It makes it possible to continue your current development paradigm on a new platform. Somehow, the DLR has been able to introduce a wild, creative, fizz to .NET Development.

How come? Simple: The DLR allows you to embed IronPython 2, IronRuby or any other DLR-based language into your application via a hosting API. If you are developing a .NET application you have instant access to the power of a dynamic scripting language. That’s not all. On Simple-Talk, Ben Hall will be showing how you can take an existing application that allows plug-ins and then extend its functionality without making any changes to the application itself. We’ll even show you how to call C# methods from IronRuby, embedded in a C# plug-in. Yes, it is versatile. It doesn’t require the two-brain skills of a mutant, and it works.

Of course, the idea of architecting an application around a scripting language isn’t new; it underlies much of the Microsoft Office products. Up to now, it has been an expensive and intricate task which has provided challenges to testers as well as developers. Once achieved, it has proven itself to be one of the better ways of layering applications, and of separating the tasks and reducing interdependencies. What is new is that it is now so simple that it can be described in an article, and allows you to embed a fully tested scripting language under a Microsoft Public License (Ms-PL) ‘to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create’.

It is time to sit back with a cup of coffee and think through the implications of this type of technology. I suspect that this will not derail Microsoft’s wholesale adoption of PowerShell for server-based scripting. However, it isn’t hard to see how this technology will radically enhance the ways with which the SMO can be harnessed to automate a lot of the routine administration work of SQL Server, in a slick and easily-maintained form. However, we can see ways in which this sort of technology can spill over into the mainstream of software development to make the work of the programmer easier, and more interesting. Check it out!

Cheers,

Laila