Dynamic Languages
Urgency: High
Risk: Low
Maturity: Low
Recommendation: Study |
When Microsoft officially introduced Silverlight at its MIX07 conference in May, the news included the first public discussions of a Dynamic Language Runtime (DLR) that would include a dynamic-type system and hosting API for next version of the .NET CLR, expected in about a year.
Dynamically typed languages have been around for years, but as Microsoft introduces services to integrate its own dynamic language implementations with .NET languages, .NET developers have the option to use more than 30 languages, according to the company.
"The DLR enables you to use .NET (including ASP.NET) from other languages besides the core VB and C# languages that most .NET developers use," notes Microsoft Developer Division General Manager Scott Guthrie in response to a blog question about who the DLR was targeted at. "If you like VB and C#, then it probably doesn't make sense to consider any changes."
The ASP.NET Futures developer preview, released in July, includes the DLR and two Microsoft dynamic languages -- IronPython 2.0 and Managed Jscript, which is based on ECMAScript 3.0. Developers shouldn't confuse Managed Jscript with JScript.NET, however, which is not fully dynamic -- these are two different language implementations.
The DLR will also host two additional implementations, underway at Microsoft-IronRuby and Dynamic Visual Basic (VB 10). Microsoft Program Manager John Lam, who created RubyCLR, an open source bridge for .NET, is heading up the IronRuby effort in Redmond. Last month, his team was planning to post the IronRuby source code on RubyForge, in an attempt to get the Ruby community to contribute to the IronRuby libraries.
"With IronPython and IronRuby and even the Java implementations, Jython and JRuby, you are now allowing these dynamic languages to leverage ecosystems that are much larger than the original languages have," says Burton Group senior analyst Richard Monson-Haefel, who points to the .NET ecosystem.
Dynamic languages are object-oriented, but the semantics of the language are different, so a lot of assumptions are made upfront, he explains. They also allow dynamic generation of new classes, and have a much more flexible programming model.
"What we found with dynamic languages in general is that they seem to be more productive on a line for line basis than conventional languages like C# and Visual Basic, Java, that sort of thing ..." he says. "As a metric for measuring productivity, that's debatable," he continues, "But what we see happening is it's anywhere from about a 2-1 to a 5-1 difference in the amount of code you need to write to accomplish a task in a dynamic language compared to a conventional language." Less code also makes the codebase a lot easier to maintain.
Dynamic languages also offer flexibility to developers, who can extend them by adding new syntax and creating domain-specific languages. A notable example is Ruby on Rails, which is an extension of Ruby. "Instead of having to use APIs all the time to accomplish a task, you can add capabilities yourself as an application developer," says Monson-Haefel.
"If you want to have a skill set for the future, then learning a dynamic language is really important," he says. "For a few more years, it will be OK to use conventional programming, but just as in the '90s -- where you couldn't really survive unless you knew object-oriented programming -- so it will be for dynamic languages. You really won't survive unless you know how to use dynamic languages and there are certain qualities that are common to dynamic languages that are not found in conventional languages."
Ruby on Rails is a rapid Web development framework that is based loosely on a Model View Controller (MVC) architecture. Microsoft is working on an MVC architecture for a future version of ASP.NET.
Monson-Haefel believes MVC architectures are much ballyhooed, but the architecture is only a small factor in the usefulness of a Web dev framework. "The advantage of that architecture is really in terms of maintenance, in general, because you are separating the view of the presentation from the model and the thing that coordinates that action between the view and the model, which is called the controller," he says. "It's easier to evolve them." If the architecture is done well, and a new presentation technology like AJAX comes out, developers could in theory evolve the presentation technology without worrying about the other parts.
"What actually ends up happening is a lot of frameworks create Model View Controller architectures, but they are so heavily integrated into the framework that it's impractical to evolve one piece without evolving the other, so you lose a lot of that advantage," explains Monson-Haefel. "I'm skeptical about any Web framework that's going to be Model View Controller, yet they're providing all the pieces."
Another pitfall is when these frameworks get so complicated that they're difficult to use, which is what happened with JavaServer Faces.
Developers interested in checking out what's coming from Microsoft should take a look at the ASP.NET Futures (July 2007) developer preview. It includes additional tooling for ASP.NET AJAX, Silverlight 1.0 (Java programming model), the Dynamic Language Runtime and two dynamic language implementations.
-- Kathleen Richards
|