|Original author(s)||Microsoft Dynamic Language Runtime Team|
|Initial release||April 16, 2010|
1.3.1 / December 2, 2021
|Operating system||Windows, macOS, Linux (Debian, Ubuntu)|
|Platform||Common Language Infrastructure|
|License||Apache License 2.0|
The Dynamic Language Runtime (DLR) from Microsoft runs on top of the Common Language Runtime (CLR) and provides computer language services for dynamic languages. These services include:
The DLR is used to implement dynamic languages on the .NET Framework, including the IronPython and IronRuby projects.
Because the dynamic language implementations share a common underlying system, it should be easier for them to interact with one another. For example, it should be possible to use libraries from any dynamic language in any other dynamic language. In addition, the hosting API allows interoperability with statically typed CLI languages like C# and Visual Basic .NET.
Microsoft's Dynamic Language Runtime project was announced by Microsoft at MIX 2007.
Microsoft shipped .NET DLR 0.9 beta in November 2008, and final 0.9 in December 2008. Version 1.0 shipped in April 2010. In July 2010, Microsoft changed the license of the DLR from the Microsoft Public License to the Apache License 2.0. With the release of .NET 4, also in April 2010, DLR was incorporated into the .NET Framework itself.
The open source DLR project hosted on GitHub has a few additional features for language implementers. After the July 2010 release, there was little activity on the project for some years. This was interpreted by a Microsoft developer who worked on IronRuby as a lack of commitment from Microsoft to dynamic languages on the .NET Framework. However, there has been regular activity since 2016/17, leading to a number of improvements and upgrades.
The DLR services are currently used in the development version of IronRuby, a .NET implementation of the Ruby language, and for IronPython.
In 2007, Microsoft planned to use the DLR for the upcoming Visual Basic 2010 (VB 10.0) and Managed JScript (ECMAScript 3.0). However, as of August 2009, Microsoft has no more plans to implement Managed JScript on the DLR. Like C#, Visual Basic can access objects from dynamic languages built on the DLR such as IronPython and IronRuby.
PowerShell 3.0, released in Windows 8, was updated to use the DLR.
IronScheme, a Scheme implementation, was planning to build upon the DLR. This idea was abandoned because the DLR branch used by the project became out of sync with the trunk, and also because (according to the project coordinator) the current version of the DLR at that time could not support the majority of Scheme's requirements.
The Dynamic Language Runtime is built on the idea that it is possible to implement language specificities on top of a generic language-agnostic abstract syntax tree, whose nodes correspond to a specific functionality that is common to many dynamic languages. This architecture is backed by the idea that the number of elementary language constructs that would have to be implemented on the generic stack should be inherently limited. The DLR dynamically generates code corresponding to the functionality expressed by these nodes. The compiler for any dynamic language implemented on top of the DLR has to generate DLR abstract trees, and hand it over to the DLR libraries.
The DLR provides dynamically-updated
DynamicSite objects that cache the task of binding methods to objects. Since the type of an object—as well as the members it contains—in dynamic languages can change during a program lifetime, a method invocation must check the method list to see if the invocation is a valid one.
DynamicSite objects represent and cache the state of the object and its methods; any update to the object is reflected in the
DynamicSite objects as well. DLR routes all method invocations via the
DynamicSite objects, which then performs a fast lookup and binding of the method with the actual implementation.
In contrast to other efforts like the Parrot virtual machine (with no dependencies) or Da Vinci Machine (built on Java's JVM by adding new bytecodes in the JVM instruction set), the DLR is built on top of the existing Common Language Runtime, the .NET Framework virtual machine.
For the short term, our focus is on using a small number of languages to drive the first wave of DLR development where we can work closely and face-to-face with the developers in order to iron out the worst kinks in the DLR design. After this initial phase, we want to reach out to the broader language community.
We don't really have a document like this but the general goal is to ship IronPython 2.0 by the end of the year. For the DLR itself the plan is to ship a v1.0 around the same time as IronPython 2.0.
A year ago the team shrunk by half and our agility was severely limited. [..] Overall, I see a serious lack of commitment to IronRuby, and dynamic language[s] on .NET in general.
Without the final push to get the languages working under Visual Studio and integrated with the designer both Iron languages are probably dead - and Microsoft seems to have lost the will to make them a success.
VB 10 takes advantage of a Silverlight feature called the Dynamic Language Runtime or DLR
The DLR JScript was experimental for informing the design of the DLR (expression trees, interop, callsites, hosting, etc.). The JS we released with asp futures and the Silverlight dynamic sdk became very old and unserviceable as the DLR continued evolving for release in CLR 4.0. Unfortunately, there are no plans at this time to develop and release a DLR-hostable JScript.
Visual Basic binds to objects from dynamic languages such as IronPython and IronRuby
Unfortunately, my DLR branch is very out of sync with the Silverlight one. I just thought about it, perhaps I do not need the DLR perse, will investigate. The problem is that the DLR as-is, is not good enough to support the majority of the Scheme's requirements[permanent dead link]
The key implementation trick in the DLR is using these kinds of trees to pass code around as data and to keep code in an easily analyzable and mutable form as long as possible.
The idea is that there's a quickly-flattening asymptotic curve to the number of expression tree nodes required to implement each new language. Whether that's the case is yet to be seen.
The differences between the CLR and JVM extensions are interesting to note. They work completely above the level of the CLR without significantly enhancing it, while we are developing the JVM and libraries at the same time.