The DLR is the dynamic language runtime that provides a common platform for dynamic languages and scripting in .NET.

Dynamic Language Runtime

Microsoft's .NET framework was designed to support a broad range of different programming languages on a Common Language Runtime (CLR). The CLR provides shared services to these languages ranging from a world-class GC and JIT to a sandboxed security model to tools integration for debugging and profiling. Sharing these features has two huge benefits for languages on the CLR. First, it's easier to implement a language because lots of difficult engineering work is already done for you. Second, and more importantly, these languages can seamlessly work together and share libraries and frameworks so that each language can build on the work of the others.

The CLR has good support for dynamic languages. The Dynamic Language Runtime (DLR) adds to the platform a set of services designed explicitly for the needs of dynamic languages. These include a shared dynamic type system, standard hosting model and support to make it easy to generate fast dynamic code. These features enable all of the dynamic languages which use the DLR to freely share code with other dynamic languages as well as with the existing powerful static languages on the platform such as VB.NET and C#.

Python and Ruby

Python is a general-purpose high-level programming language. Its design philosophy emphasizes code readability. Python claims to combine remarkable power with very clear syntax, and its standard library is large and comprehensive. Its use of indentation as block delimiters is unusual among popular programming languages.

Ruby is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features. Ruby originated in Japan during the mid-1990s and was initially developed and designed by Yukihiro "Matz" Matsumoto.

The two main DLR languages, Python and Ruby, are available to develop your programs and also to be hosted in your programs. DLR hosting means that the users of your program can use scripting in any DLR language, for example to automate your program or to programmatically access the domain model of your application.

The DLR Shell implements a DLR host that is available to all Silverlight applications loaded in Silverlight Spy.

Managed JScript

Early incarnations of Silverlight featured an implementation of JavaScript on top of Dynamic Language Runtime. Unfortunately managed JScript has been removed. Appearantly the DLR JScript was experimental for informing the design of the DLR (expression trees, interop, callsites, hosting, etc.). The JS that was released with the Silverlight dynamic SDK became very old and unserviceable as the DLR continued evolving for release in CLR 4.0.

See Also