January 22, 2021
Hot Topics:

Dynamic Language Support in the .NET 4.0 Framework

  • By Mark Strawmyer
  • Send Email »
  • More Articles »


Welcome to this installment of the .NET Nuts & Boltscolumn! The focus of this article will be on the dynamiclanguage support that will be released as a part of theupcoming 4.0 version of the .NET Framework. In order to runthe examples contained within this article you'll need touse an early preview such as a beta or CTP of the .NETFramework 4.0 release.

Note: In order to run the examples contained withinthis article you'll need to use an early preview such as abeta or CTP of the .NET Framework 4.0 release.

Dynamic Language Runtime (DLR)

Dynamic languages are those that have a loose couplingbetween applications and data services. They involvedimplicit typing, meta programming, and do not involvecompilation. The popularity of dynamic languages such asPython, Ruby, and JavaScript can be seen all across theInternet. To date Microsoft .NET has been about staticlanguages.

The argument for and against dynamic languages and staticlanguages has been around since programming languages werefirst created. Each paradigm has its strengths andweaknesses. The Common Language Runtime (CLR) is a commonplatform introduced in Microsoft .NET 1.0 for staticallytyped objects. Since the static paradigm was the onlyparadigm supported, those seeking support for dynamiclanguages were forced to turn elsewhere.

The Dynamic Language Runtime (DLR) introduces support fordynamic languages on .NET. This creates the possibility of a"best of" scenario where you can use from both paradigms.The core infrastructure of the DLR includes expression trees(such as LINQ), dynamic dispatch to different binders, andcall side caching to avoid resolving to the same locationmore than once. The DLR interfaces with other platform typesvia binders. There are binders that map dynamic objects tostatically typed .NET objects, a JavaScript binder thatallows binding directly to JavaScript in Silverlightapplications, COM objects, and Python and Ruby. It providesa single programming experience for talking to all of theseenvironments that are not statically typed.

Chart showing Dynamic Language Runtime Flow
Click here for larger image

Figure 1 - Dynamic Language Runtime

Page 1 of 2

This article was originally published on December 11, 2009

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date