Tuesday, January 16, 2007

C# godfather Anders Hejlsberg on dynamic languages, LINQ

As C# continues to gain adherents, developers continue to closely watch the comments of Microsoft's Anders Hejlsberg, chief designer of C#. What better way is there to gauge the direction the language will take next?

Last month at TechEd Europe in Barcelona, Hejlsberg discussed software futures that include more dynamic language support, and more integrated query support.

He suggested that a mixture of dynamic and static language traits was emerging as a prominent programming trend. Also, he and said he saw indications that Microsoft's Language Integrated Query project would be supported by third-party makers of object/relational mapping tools

Dynamic range
While static-typed object-oriented languages like C# and Java made great headway in the last five years, dynamic languages have not take an backseat. Certainly, dynamic Python has continued to flourish and Ruby has gained considerable momentum. Melding of dynamic and static alternatives are being pursued by both Java-proponent Sun and .NET-originator Microsoft.

''It is funny to watch the pendulum swing back and forth between static and dynamic typing. I think the mega trend probably is that there is more of a fusing of a number of different programming languages occurring right now,'' said Hejlsberg.

He continued: ''You can look at classical object-oriented dynamic and functional programming languages, and in a sense, they are all fusing, coming together in sort of a new style of programming language. I certainly aim for C# to stay on the forefront of that.''

Hejlsberg indicated that aspects of functional programming are creeping into the mix that makes the modern software language.

''When you ask why people like dynamic language, people often say it's because [they] have to write less or because it’s terser or succinct and you try and dig a little bit…and often one of the reasons that gets cited is there are no types there, and therefore types get in the way. We all know that strong typing is a sort of a lever. And the further you dial it up the more painful it gets.''

''However, one of the things that we are learning a lot from functional programming languages is in the area of type inference. It is one of those … 'have your cake and eat it too' kind of things. It is actually strongly typed''

''When types are gone, there are just a lot of things a tool can no longer do for you,'' Hejlsberg advised, adding that his approach was to look for ''the happy medium.''


LINQ looms
Perhaps the biggest change due in C# next year is LINQ, based on a project that Hejlsberg and others spearheaded, and which is due to ship with Orcas, the next version of Visual Studio. LINQ (for Language Integrated Query) is intended to integrate query building into the language to make it easier for developers to create data queries that work across objects, databases and XML data.

Like many things Microsoft is pursuing these days, LINQ is intended to be extensible, so it can be used across a variety of languages other than C#, not the least of which is Visual Basic.

In his video interview at TechEd Europe, Hejlsberg said he welcomes third-parties that build on the LINQ concept. ''I have already seen several ORM providers support it in their Object/Relational mappings, which is wonderful.'' A ‘Virtual’ version of that broadcast is available on the Web.

Related interview with Microsoft’s Anders Hejlsberg
http://www.mseventseurope.com/Teched/06/Pre/Live/VideoDev8.aspx?id=4#an4