InfoQ

News

C# Team talks about the future with Future Focus

Posted by Robert Bazinet on Feb 01, 2008 04:50 PM

Community
.NET
Topics
.NET Framework ,
Dynamic Languages
Tags
C# ,
DLR

The C# team members of Charlie Calvert and Mads Torgersen announced they are creating Future Focus, a series of monthly blog posts detailing plans for future versions of C#.

What is Future Focus?

According to Charlie Calvert, Future Focus is:

It is important that readers of this column have the right expectations. The information in this column is meant to be a helpful guideline for C# developers, and not a binding commitment. We are not attempting to give a complete list of features in the product, but only to share what we can in a way that will be easily accessible to all C# developers. The Visual Studio schedule, unforeseen technical problems, intellectual property rights and competitive pressures may impact our schedule or our ability to share our plans. We will, however, do our best to keep you up to date on the latest news from the team as they design and implement future versions of the C# language.

Future Focus is not intended to give a detailed specification of future features but instead, give an overview in broad strokes of those features in comprehendible terms.

Future Focus I

The first installment of the C# information update talks about Dynamic Lookup.   The next version of Visual Studio will include this feature which will enable all .NET languages to optionally resolve names in a program at runtime instead of at compile time.   Charlie tells us that:

Work on support for dynamic lookup was begun in the CLR, but soon became part of the Dynamic Language Runtime, or DLR. The DLR provides the infrastructure on which a common set of dynamic tools can be built. For instance, the DLR provides the infrastructure for both IronRuby and IronPython. It will be the infrastructure on which the C# team implements dynamic lookup .

Support for dynamic lookup is already available in Visual Basic for .NET, where it is often known as “late binding”. The new release of .NET will provide C# developers with similar functionality, while at the same time providing a shared infrastructure for runtime name resolution across all .NET languages, including VB.

The article details common scenarios when Dynamic Lookup is useful:

  • Office Automation - In the next version of Visual Studio Office automation will be easier. Developers will be freed both from the need for using a bulky type library, and the need for including optional arguments in their method calls. The support for Office Automation will be part of a general effort to enhance support for COM Interop and Office PIA.

  • Consuming Dynamic Languages - Dynamic languages such as IronPython or IronRuby are becoming increasingly popular. At this time, those languages can call C# code, but we can’t easily call into their code. The next version of Visual Studio will simplify the steps C# developers take to call into IronPython or IronRuby classes. This will give developers access to a useful existing code base, and an alternative way to write new code.

  • Call Reflection - C# developers can currently use reflection to instantiate classes and call arbitrary methods that are not known at compile time. The dynamic extensions to the C# language will make it much easier to make such calls.

The development of the Dynamic Language Runtime (DLR) makes this particularly important the growing popularity of dynamic languages and the need to be able to communicate between dynamic and non-dynamic languages.  Products such as Silverlight 2.0, set to be released at some point in the future, will rely heavily on the dynamic nature of the languages it hosts.

Charlie gives us a glimpse at what a dynamic lookup might look like:

The syntax that will be used for dynamic lookup has not yet been finalized. The code that I show here is therefore only a tentative sketch that reflect the team’s evolving plans.

The team is currently considering adding the keyword dynamic to the language and using it to demarcate a block of code:

static void Main(string[] args)
{
dynamic
{
object myDynamicObject = GetDynamicObject();
myDynamicObject.SomeMethod(); // call a method
myDynamicObject.someString = "value"; // Set a field
myDynamicObject[0] = 25; // Access an indexer
}
}

All the code that occurs in a dynamic block will potentially support dynamic lookup; even if the accessed members are not known by the C# compiler to exist, it will allow the code. At runtime the DLR will look at the actual object referenced by myDynamciObject for members with those names. It will access them if they do indeed exist, otherwise an exception is thrown. Outside of a dynamic block developers can only call C# code statically, just as they do today.

Watch for future postings of Future Focus on Charlie's Blog and learn more about the future of C#.

1 comment

Reply

Monthly .. by Cameron Purdy Posted Feb 2, 2008 10:59 AM
  1. Back to top

    Monthly ..

    Feb 2, 2008 10:59 AM by Cameron Purdy

    Nice, a monthly blog post to go with the seemingly monthly upgrades to C# and .NET ;-)

    Peace,

    Cameron Purdy
    Oracle Coherence: Data Grid for Java and .NET

Exclusive Content

Ruby.rewrite(Ruby)

In this RubyFringe talk, Reginald Braithwaite writes Ruby code to read, write, and rewrite Ruby. Demos include extending Ruby with conditional expressions, call-by-name and more.

Book Except and Interview : Aptana RadRails, An IDE for Rails Development

Aptana RadRails: An IDE for Rails Development by Javier Ramírez discusses the latest Aptana RadRails IDE, a development environment for creating Ruby on Rails applications.

Fast Bytecodes for Funny Languages

Cliff Click discusses how to optimize generated bytecode for running on the JVM. Click analyzes and reports on several JVM languages and shows several places where they could increase performance.

Scott Ambler On Agile’s Present and Future

Scott Ambler, Practice Lead for Agile Development at IBM, speaks on the current status of the Agile community and practices having a look at the perspective of the Agile’s future.

Manager's Introduction to Test-Driven Development

Dave Nicolette and Karl Scotland try to introduce non-technical managers to one of the most popular Agile development techniques: Test-Driven Development (TDD).

Structured Event Streaming with Smooks

Smooks is best known for its transformation capabilities, but in this article Tom Fennelly describes how you can also use it for structured event streaming.

How to Work With Business Leaders to Manage Architectural Change

Successful architectures evolve over time to meet changing business requirements. Luke Hohmann presents how to collaborate with key members of your business to manage architectural changes.

Colors and the UI

In this article, Dr. Tobias Komischke explains how colors used in a GUI can influence our interaction with a computer and offers advice on using the appropriate colors for the interface.