C# 4.0 – Dynamic Language Runtime

Dynamic languages are a class of high-level programming languages that execute at runtime many common behaviors that other languages might perform during compilation, if at all. Most of you probably spend most of your time in static languages. What are the differences?

image

Dynamic languages allow you to develop prototypes faster because you don’t need to worry about type.

I started to learn more about this here: https://channel9.msdn.com/pdc2008/TL10/. Jim Hugunin does a great job. I’m going to try to address his presentation in the form of a re-blog.

You can get his Powerpoint dec here ->Powerpoint Deck

This is a good high level view of what’s going on.

image

Components of the DLR (Dynamic Language Runtime)

Expression Trees-dealing with code at runtime that is easy to understand, optimized by the CLR at runtime.

Dynamic Dispatch – allow different languages to communicate

Call Site Caching – to provide good performance

More languages in the future

More languages will be built upon this.

You can talk to javascript objects, python, COM objects (for Office), .NET 


 

Open Source Efforts – DLR

DLR is an open source project which grew out of IronPython and IronRuby. Approved by OSI it is available to language implementers who need source to make their languages work better.

You can download it now here.

https://www.codeplex.com/dlr

 

The evolution of dynamic language features

image

 

COM – Needs Dynamic Dispatch

image

 

 

Dynamic Languages match types at runtime

image

 

Sample Python Code

image

 

Note that Python has no types

image

 

Name and optional arguments

 

image

 

Finally, easier MS Office Integration

 

image

 

The Future - Past C# 4.0 – Allowing you to control the compilation process

 

 

image