.Net

The Dynamic Language Runtime (DLR)

The Dynamic Language Runtime (DLR) is built on top of the Common Language Runtime (CLR) and opens the door for a common set of technologies and tools to interoperate inside a common framework.  The Dynamic Language Runtime environment enables the developers to implement applications using dynamic languages like Python and Ruby on top of the .NET Framework runtime. It is a runtime environment built on top of the managed environment of the CLR that provides support for implementing dynamic features in statically typed languages, sharing of libraries and objects and fast dynamic dispatch and invocation.
Dynamically typed languages such as Python, Ruby, and JavaScript can reside alongside familiar statically typed .NET languages such as C#, Managed C++, and Visual Basic. The CLR provides a common platform where statically typed languages (e.g. C#, VB) can reside and interoperate, while the DLR sits on top of the CLR and provides a common platform for dynamically typed languages to reside and interoperate.
The Wikipedia states: "The Dynamic Language Runtime (DLR) from Microsoft is an ongoing effort to bring a set of services that run on top of the Common Language Runtime (CLR) and provides language services for several different dynamic languages." Reference: http://en.wikipedia.org/wiki/Dynamic_Language_Runtime
The DLR adds a set of services that facilitate dynamic language implementations on .NET's managed platform. These services include support for a dynamic type system, a standard hosting model, and fast dynamic code generation. In addition, the DLR lets dynamic and static languages interoperate bi-directionally.
The new System.Dynamic namespace in Microsoft .NET Framework 4.0 provides support for the Dynamic Language Runtime environment. The MSDN states: "The dynamic language runtime (DLR) is a runtime environment that adds a set of services for dynamic languages to the common language runtime (CLR). The DLR makes it easier to develop dynamic languages to run on the .NET Framework and to add dynamic features to statically typed languages." Reference: http://msdn.microsoft.com/en-us/library/dd233052.aspx
The Dynamic Language Runtime is comprised of the following three layers:
1.       The .NET Language Integration Layer
2.       The Dynamic Language Runtime Code Components
3.       Language Binders
The Dynamic Language Runtime environment provides the following services:
  • Dynamic Method Dispatch
  • Dynamic Code Generation
  • Hosting API