The Future of C#

by mheydt 27. October 2008 19:13 >
Three primary trends:
  1. Declarative
  2. Dynamic
  3. Concurrent
Trend is towards multi-paradigm programming languages.

Declarative means what, not how.

Need to define languages to build multiple items of work that can be automatically parallelized.

Major theme in C# 4.0 is Dynamic Programming.
- This is meant to be anything that are not .NET classes.
-- Dynamically types objects
-- Optional and named parameters
-- Improved COM Interop
-- Co and contra-variance

Dynamic Language Runtime
- Expression Trees
- Dynamic Dispatch
- Call site Caching

Below the DLR are binders for:
- .NET
- Sivlerlight
- Python
- Ruby
- Office

Right now there is a different bridge to different dynamic languages.
With C# 4.0, you use dynamic instead of var or a type.  Ex:

dynamic calc = GetCalculator();
calc.Add(10, 30);

calc can be Ruby, C#, Python, ...

Add compile time it is dynamic. 
Memver selection deferred to run-time.
Actual types are substituted for dynamic
static result type of operation is dynamic.

This is interesting as the dynamic keyword lets you use dynamic objects in a static way.

This is all done by implementing from DynamicObject, which supports IDynamicObject.

Note that you do not get Intellisense on variables declared dynamic, which makes sense.

There is native support for DuckTyping.

You can now do optional parameters in C# just like in C++ (YEAH!!!!!!!!!!)

Named arguments use : syntax, and must be last items on the list.  Note that optional, named parameters may have side effects.

Don't have to specify "missing" by ref for com objects!

Past 4.0, there will be support for modern metaprogramming.  Compiler will be evolved to be a service.  This will allow support of:
- Meta-programming
- Read-Eval-Print loop
- DSL Embedding
- Language Object Model

Tags:

.Net | C# | PDC08

blog comments powered by Disqus

about the author

I'm a .NET, XAML, and iOS polyglot that loves playing with new things and making cool and innovative stuff.  I am also a Mac junkie.

I am Principal Technologist for SunGard Global Services in NYC, in their Advanced Technologies practice, and I work extensively with SunGard's energy and financial customers.

Note the the posting on this blog are my own and do not represent the position, strategies or opinions of SGS.

twitter

I can't stop thinking big!
Sunday 1:08AM via WindowsLive
Just watched Moneyball. That's my pick for best movie this year.
Saturday 3:51PM via WindowsLive
@vincebelpiede: Report: Skype For Windows Phone Beta Imminent http://t.co/KYNjgg1L#mhtnd
Wednesday 8:39AM via Twitter for Mac
@mashable: Kinect Fusion Will Turn Gaming (and More) Into a 3D Fun House - http://t.co/Ihrq2fY2#mhtnd
Wednesday 8:39AM via Twitter for Mac
New Kinect SDK: http://t.co/57MvA5L5 #mhtnd
Wednesday 8:39AM via Twitter for Mac
Follow me on Twitter

recent comments

None

month list