PDC2008: New features in C##
Just been to Anders Hejlsberg’s talk on the future of C#, where he outlined what’s coming in C# 4.0 and (some) of what might come in C# 5.0.

Importantly: C# 4.0 focuses on Dynamic Languages (i.e. the Dynamic Language Runtime (DLR))  and concurrent programming (i.e. programming for multi-core CPUs).

New in C# 4.0 is support for the attic type dynamic.
This allows you to specify a type which isn’t known until runtime.

Under the hood, it all seems to use the whole Type Invoke mechanism (i.e. reflection, which can be very slooooooow).
Which leads me to wonder: dynamics in C# 4.0 look like they’re cool in certain situations, but you end up with perf-problems, and the possibility for difficult-to-find runtime bugs.

For example, if I typed:
dynamic calc = GetCalculator();
int val = calc.App(2, 10);

Instead of

int val = calc.Add(2, 10);
well.. I won’t know that there is a  bug until I get to that line as it’s dynamically executed
At least, that’s my understanding.
It’ll be interesting to see how they address this.

In C# 5.0, Anders showed how they’re re-writing the C# compiler (csc) in managed code – and allowing you to interact with it from code.
Specifically, he showed how to dynamically generate, compile and execute code.. similar to what CodeDOM does today, but much much cooler.

Monday, October 27, 2008 10:47:56 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  |  Trackback


Comments are closed.
All content © 2020, Daniel Probert
On this page
This site
<August 2020>
Blogroll OPML

Powered by: newtelligence dasBlog 2.3.12105.0

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts

Pick a theme: