PDC 2009 Day 1: Future Directions for C# and Visual Basic

I attended the PDC breakout session named “Future Directions for C# and Visual Basic” given by Luca Bolognese, the Languages Group Program Manager. This session presented both features that exist in Visual Studio 2010 and features that would be added in future releases, however on my post I’ll concentrate on the new future directions.

Compiler as a Service

An interesting direction the Languages Group is taking is opening up the C# and VB compilers to custom extensions. An example of utilizing this would be adding a custom compile time refactoring rule – either a simple refactor like changing the order of parameters in a certain function call, or a more complex rule which is able to visit the call tree in the code and manipulate it as you wish.

Users could extend the compiler via a .NET managed API which would expose the compiler as a service. Eventually, this would allow users to create custom declarative syntax which would compile just like regular code.

Asynchronous Programming

The languages team is considering adding a new “yield” keyword which would allow easily performing operations in an asynchronous manner.

E.g. Async<long> result = yield GetWebPage();

The point is that currently writing code that does this operation asynchronously is achievable via the Asynchronous Programming Model (APM), however it requires a significant amount of code which the user is basically not interested in, especially when taking into account all the plumbing and  exception propagation code which should be written. The “yield” keyword is supposed to hide all of these implementation details away.

Immutable Classes

Luca briefly mentioned that the team is exploring a way to add immutable classes to the language. If this actually materializes, this could fill up quite a large gap which exists from the beginning of .NET programming in the ability to easily create and return a class which is immutable. I would sure like to here more about this area in the future.

Comments are closed, but trackbacks and pingbacks are open.