Three primary trends:
- Declarative
- Dynamic
- 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
276cc183-60fe-492f-ba80-55ea057ea787|0|.0