Friday, October 31, 2008

Reading about how dynamic is implemented in C# 4.0 over on Sam Ng's blog: Dynamic in C#

How did they implement the new dynamic 'keyword' in C# 4.0? Using the DLR, of course!

Very cool to see that the C# version of dynamic dispatch is implemented over the same mechanisms for call actions, dynamic objects and binders to generate expression trees, with some C# specifics in the binder to implement C#'s rules for dispatch etc.

It's interesting to see the flow-on effects of using a dynamic type in an expression and how the 'dynamism' then flows on to subsequent expressions or invocations involving the resulting object.

Quite a nice bit of work, and well explained by Sam. He's going to post more in the series, so worth subscribing to his blog.

Kirk

posted on Friday, October 31, 2008 12:06:10 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]