Microsoft Phasing in Support for Dynamic Languages on .Net

 
 
By Darryl K. Taft  |  Posted 2006-08-09
 
 
 

Microsoft Phasing in Support for Dynamic Languages on .Net


Microsoft is working on a phased approach to enhancing its support for dynamic languages on the companys .Net platform.

Jim Hugunin, creator of the IronPython language and a development leader on Microsofts CLR (Common Language Runtime) team, told eWEEK that Microsoft is working to help usher in support for dynamic languages on top of the CLR in a variety of levels or phases.

At the lowest level, Microsoft will be building additional support for dynamic languages into the overall .Net plumbing, Hugunin said. A level up from there, Microsoft will instantiate successful software patterns and practices into code that developers can call on from libraries to help them build applications using dynamic languages on the .Net Framework.

And a level up from the libraries, Microsoft will offer lessons learned, based primarily on its work with IronPython, the companys implementation of the Python programming language running on .Net.

IronPython reached Release Candidate 1 status on July 26, and barring any problems, the technology will be released as a 1.0 version in a week or more, Hugunin said. IronPython officially releases every three weeks, but as the code is hosted on Microsofts CodePlex community development Web site, interested developers can gain access to new drops of code on an almost daily basis, he said.

Click here to read more about the release candidate for IronPython 1.0.

Microsoft is taking measures to enhance its development platforms support for dynamic languages as developer demand for, and use of, the languages such as Python, PHP, Perl, Ruby and others continues to grow. Both Microsoft and Sun Microsystems—and the Java community—realize the growing need to support dynamic languages on their platforms.

In fact, dynamic languages dominated the conversation at the recent Lang.Net 2006 Symposium held July 31 through Aug. 2 on Microsofts Redmond, Wash., campus. Hugunin spoke with eWEEK at the event.

"As I think about where we go beyond IronPython, what we really want to do next is try to generalize what weve learned," Hugunin said.

For instance, Hugunin said, he has spent a lot of time talking to Microsofts Visual Basic team and to the Windows PowerShell team. PowerShell is a relatively new shell scripting language, formerly known by the code name Monad, which people can use instead of command.com, he said.

"And their rules arent very different from ours," he said. "So if we could combine the best of what everybodys learned and tell people, Here is how you do it, then Ruby becomes easy."

Moreover, Hugunin explained the hierarchical approach he sees Microsoft bringing to dynamic language support.

"There is stuff that will make it into the CLR, and that will be the stuff we know best," he said.

Indeed, an example of the kinds of dynamic language support Microsoft put into .Net 2.0 "is dynamic methods, which is a general-purpose feature that people can build a lot of things on top of," he said.

John Lam, a principal consultant and partner at ObjectSharp Consulting, in Toronto, and also creator of RubyCLR, a .Net to Ruby interoperability bridge, said the baked-in support for dynamic languages in Net 2.0 has helped him in his work.

Lam, who also presented at Lang.Net, said, "In .Net 2.0 the major feature that I rely on, and tons of other people do too, is this thing called the dynamic methods. Dynamic methods allow us to gain an incredible amount of flexibility. … RubyCLR is built entirely on top of dynamic methods." And this enables Lams solution "to have high performance and some of the other things that are more challenging to do without that kind of support built into the platform."

Next Page: Dynamic language library.

Page 2


Hugunin also spoke about the libraries Microsoft will ship on top of the CLR.

"What were going to try hard to do is, instead of doing a dynamic language specification, provide a dynamic language library and have guidance on how to use it, because Im a firm believer in whenever you can capture something in code instead of text its a far better way to capture it," Hugunin said. "So were going to try to capture as much of these guidelines as we can in code."

Lam said he believes a "reasonably large" percentage of all dynamic languages are fairly similar. "So things like support for arbitrary length integer numbers is something that both Python and Ruby support," he said. "Yet those would be things that you would otherwise have to implement yourself."

However, these things are not easy to implement, Lam said. "So being able to pull some of that stuff out and put it into a common set of libraries that could be shared across multiple languages is something thats very important," he said.

And beyond the libraries, Microsoft will make IronPython available as a working example of "how you build a first-class production language running on .Net. So for the things that we cant generalize into the library, we can show people, Heres how we solved it for this one language."

Hugunin on Aug. 1 celebrated his second anniversary at Microsoft.

He said he started out in the latter half of 2003 tinkering with .Net and planning to write an article on why .Net was a terrible platform for dynamic languages. However, after he performed a few tests of his own he found out that .Net, and particularly the CLR, was an "excellent target" for Python, and so he started working on the implementation he called IronPython. Then, feeling he could work better as part of the company, Hugunin joined Microsoft in August of 2004.

Yet, "the first six months were horrible," he said, as most of his time was spent helping to get Microsofts Visual Studio 2005 out the door. But after that he was able to focus on working on IronPython and working with the CLR team.

"I joined Microsoft because I was so inspired by the possibilities of .Net," Hugunin said. "The chance to work with the Visual Basic team is wonderful. The chance to make changes into .Net to make it more amenable to dynamic languages is phenomenally exciting."

Sun is looking at Java extensions to better support dynamic languages on the Java Virtual Machine. Click here to read more.

At Lang.Net, Hugunin gave attendees a peek at some of the work he is doing to integrate IronPython with Visual Basic and with PowerShell.

"If you happen to be a Python programmer and youre the administrator on a Windows machine, well youve got these great libraries that PowerShell makes available and theres no reason you shouldnt write Python code instead," Hugunin said. "If youre a VB programmer, again, it should be very natural to use these PowerShell libraries because theyre very dynamic libraries that fit nicely with the dynamic languages."

Hugunin said Microsoft wants to make all of the PowerShell libraries as easily usable from other dynamic .Net languages as they are from the PowerShell scripting language.

Likewise, with Visual Basic, Hugunin said Microsoft is looking at leveraging some of the simplicity that Basic has. "That feels a lot like what people say they love today about dynamic languages," he said. "People say they love a language like Ruby because it has this simplicity and this dynamism."

And Visual Basic, in its formative years, "was state of the art in providing this simple, dynamic experience. So we see that theres this great potential for Basic to be another great dynamic language, where we keep all the great benefits that we put into Visual Basic .Net, but we have some of this dynamic feel that people love."

Hugunin demonstrated how, with simple changes in the code, Visual Basic could be made to behave like a dynamic language. "But thats just, at the moment, an experiment," he said with a smile.

Check out eWEEK.coms for the latest news, reviews and analysis in programming environments and developer tools.

Rocket Fuel