Microsoft is factoring in the use of dynamic languages in its upgrade to the Visual Studio software development platform.
The upcoming Visual Studio 2010 release boosts interoperability between the Visual Basic and C# languages and dynamic languages, Microsoft's S Somasegar, senior vice president of the Microsoft developer division, says in a blog entry. C# 4.0 and Visual Basic 10.0 will be available in Visual Studio 2010 and are currently offered in the beta release of the development platform.
"C# 4.0's major themes are interoperability with dynamic programming paradigms and improved Office programmability. Dynamic lookup, a new feature in C# 4.0, allows you to use and manipulate an object from IronPython, IronRuby, JScript, the HTML DOM, or a standard .Net library in the same way, no matter where it came from," Somasegar wrote.
A dynamic keyword capability in C# 4.0 allows a type to be resolved dynamically at runtime rather than in a static fashion compiled at runtime. "This allows dynamic languages to expose their objects to C# in a way that feels natural to a C# programmer," he wrote.
For Visual Basic, interoperability with dynamic languages is made simpler through such techniques as use of code snippets to call a Python library.
"Language enhancements, such as named and optional parameters and improved support for COM clients, give C# developers who are working with Office APIs the same great experience that Visual Basic developers have enjoyed," he wrote.
"The Visual Basic team focused on adding productivity features to the language so developers can get more done in fewer lines of code," Somasegar says. "The most common customer request for Visual Basic is to remove the underscore ("_") character when breaking a code statement across multiple lines in most cases. Visual Basic 10 introduces implicit line continuation, which removes the need for the underscore character in most cases."
Also featured for Visual Basic are auto-implemented properties, in which lines of boilerplate property implementation code can be replaced with one-line declarations. Collection initialisers and array literals also are simpler. "Collections can now be initialised when they're declared, and the type of array literals is inferred by the compiler," Somasegar wrote.
Support for lambdas has been improved for Visual Basic. With Visual Basic 10, lambdas can contain expressions that do not return a value. Capabilities like multiple lambdas are supported, with the compiler inferring parameter and return types when possible, just like in regular lambdas.