News

.NET Gets Dynamic

Dynamic Language Runtine (DLR) to be part of the next versions of Silverlight and AJAX.

Microsoft's announcements at the MIX07 conference in late April included a Dynamic Language Runtime (DLR) as part of the next iteration of Silverlight, its cross-platform browser plug-in. But the DLR's reach goes far beyond Silverlight.

Due to the timing of the DLR announcement, "a lot of people have the misconception that the DLR is a Silverlight-only thing," says John Lam, a Microsoft program manager. "That's not true. The DLR will run wherever the desktop CLR will run."

In addition to Silverlight 1.1, currently in alpha, DLR bits are in a May developer preview of ASP.NET Futures, the next version of ASP.NET, which is expected sometime next year-post Visual Studio "Orcas" and .NET 3.5. "It's going to allow you to use dynamic languages like IronPython or IronRuby inside of your ASP.NET pages," says Lam. It will also make functionality such as data binding more seamless.

DLR integration into Visual Studio and .NET is further out. "We're not shipping in the Orcas release of .NET," confirms Jim Hugunin, architect of the DLR. "The expectations are for it to be in future versions."

With the DLR in play at least, there's finally a roadmap for greater dynamic language support on .NET. "Multi-programming languages has been one of the big cornerstones of the .NET Framework since it launched," observes Directions on Microsoft analyst Greg DeMichillie. "Back then, they were trying to compete with Java, and they really were pretty much any programming language except dynamic programming languages for a while."

Microsoft is still language-neutral, he says: "I don't think they're trying to introduce C# developers to Ruby as much as they're trying to make .NET an attractive platform for people who have bought into dynamic languages."

Lessons from Python
Hugunin's goal is just that. He joined Microsoft to work on IronPython for the .NET Framework CLR 2.0. IronPython 1.0 was released last August. "One thing we're trying to do with the DLR is take some of the hard things that we did in IronPython and put them into a shared library," he says.

IronPython can talk to static languages such as VB.NET and C#, but it can't share code with other .NET dynamic language implementations. "The biggest thing that the DLR does is it takes that notion of how to do dynamic operations and it makes it common, so that dynamic languages built on top of this common platform can now all talk to each other," Hugunin explains.

The DLR adds a small set of features to the .NET Framework CLR 2.0. The key component, according to Hugunin, is the shared dynamic-type system, which allows the languages to "talk" to each other and share code. Other features include a standard set of hosting APIs and a set of libraries for compilers. It also offers performance enhancements, such as a method dispatch mechanism called Dynamic Science, which does some caching for more effective dispatch, according to Lam.

Under the current roadmap, the DLR will support IronPython, Managed JScript and two upcoming language implementations-IronRuby and Dynamic Visual Basic. Lam, who joined Microsoft in January, is heading up the IronRuby project and is known in the dynamic community for his work on a .NET bridge, the RubyCLR. "This is not a commitment by any stretch," he says, "but we would like to ship the source code release of IronRuby before OSCON this year, which will be July 23."

Ruby's malleability for building what Lam calls, "small, internal domain-specific languages" and embedding these model languages inside of itself-examples are Rails and Rake-may eventually lend itself to enterprise developers who want to codify business rules within their applications or organizations.

Dynamic Visual Basic, unlike IronRuby, is not a new language implementation per se. "All the plans for shipping are around the next version of Visual Basic," says Hugunin. "It's not about creating a new kind of Visual Basic. It's about adding some of the dynamic features-some of them are historic to Visual Basic."

Open Source Feedback
The plans are ambitious, and the DLR is still in the very early stages. The source code, however, is available now on Microsoft's CodePlex for the open source and "bleeding-edge crowd," says Hugunin. "There's a certain community, in particular of language developers ... and being out there in source form lets us engage with them now before we have to lock down the API in the final post-Orcas release." For the enterprise crowd, "there will certainly be some RTM version of it in 2008," says Hugunin.

In addition to Hugunin and Lam, the team at Microsoft includes Paul Vick, known for his work on Visual Basic Futures, and Allen Wirfs-Brock, who created an early implementation of Smalltalk.

"The Rails framework ... and the resurgence of JavaScript and AJAX on the browser almost created a perfect storm of interest around dynamic languages," observes Lam. The DLR, when it ships, will allow developers to use a set of languages that they previously weren't able to use on the .NET platform.

About the Author

Kathleen Richards is the editor of RedDevNews.com and executive editor of Visual Studio Magazine.

comments powered by Disqus

Featured

Subscribe on YouTube