The Dynamic Language Runtime (DLR) from
Microsoft runs on top of the
Common Language Runtime
The Common Language Runtime (CLR), the virtual machine component of Microsoft .NET Framework, manages the execution of .NET programs. Just-in-time compilation converts the managed code (compiled intermediate language code) into machine instructio ...
(CLR) and provides
computer language services for
dynamic language
In computer science, a dynamic programming language is a class of high-level programming languages, which at runtime execute many common programming behaviours that static programming languages perform during compilation. These behaviors cou ...
s. These services include:
* A dynamic
type system, to be shared by all languages using the DLR services
*
Dynamic method dispatch
*
Dynamic code generation
* Hosting API
The DLR is used to implement dynamic languages on the
.NET Framework
The .NET Framework (pronounced as "''dot net"'') is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. It was the predominant implementation of the Common Language Infrastructure (CLI) until bein ...
, including the
IronPython
IronPython is an implementation of the Python programming language targeting the .NET Framework and Mono. Jim Hugunin created the project and actively contributed to it up until Version 1.0 which was released on September 5, 2006. IronPython 2.0 ...
and
IronRuby
IronRuby is an implementation of the Ruby programming language targeting Microsoft .NET Framework. It is implemented on top of the Dynamic Language Runtime (DLR), a library running on top of the Common Language Infrastructure that provides dynamic ...
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.
History
Microsoft's Dynamic Language Runtime project was announced by Microsoft at
MIX
Mix, mixes or mixing may refer to:
Persons & places
* Mix (surname)
** Tom Mix (1880-1940), American film star
* nickname of Mix Diskerud (born Mikkel, 1990), Norwegian-American soccer player
* Mix camp, an informal settlement in Namibia
* 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
The Shared Source Initiative (SSI) is a source-available software licensing scheme launched by Microsoft in May 2001. The program includes a spectrum of technologies and licenses, and most of its source code offerings are available for download aft ...
to the Apache License 2.0. With the release of .NET 4
Microsoft started development on the .NET Framework in the late 1990s originally under the name of Next Generation Windows Services (NGWS). By late 2001 the first beta versions of .NET 1.0 were released. The first version of .NET Framework was r ...
, 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
IronRuby is an implementation of the Ruby programming language targeting Microsoft .NET Framework. It is implemented on top of the Dynamic Language Runtime (DLR), a library running on top of the Common Language Infrastructure that provides dynamic ...
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.
Supported languages
The DLR services are currently used in the development version of IronRuby
IronRuby is an implementation of the Ruby programming language targeting Microsoft .NET Framework. It is implemented on top of the Dynamic Language Runtime (DLR), a library running on top of the Common Language Infrastructure that provides dynamic ...
, a .NET implementation of the Ruby language, and for IronPython
IronPython is an implementation of the Python programming language targeting the .NET Framework and Mono. Jim Hugunin created the project and actively contributed to it up until Version 1.0 which was released on September 5, 2006. IronPython 2.0 ...
.
In 2007, Microsoft planned to use the DLR for the upcoming Visual Basic 2010 (VB 10.0) and Managed JScript
JScript is Microsoft's legacy software, legacy dialect of the ECMAScript standard that is used in Microsoft's Internet Explorer 11 and older.
JScript is implemented as an Active Scripting engine. This means that it can be "plugged in" to OLE Aut ...
( 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
IronPython is an implementation of the Python programming language targeting the .NET Framework and Mono. Jim Hugunin created the project and actively contributed to it up until Version 1.0 which was released on September 5, 2006. IronPython 2.0 ...
and IronRuby
IronRuby is an implementation of the Ruby programming language targeting Microsoft .NET Framework. It is implemented on top of the Dynamic Language Runtime (DLR), a library running on top of the Common Language Infrastructure that provides dynamic ...
.
PowerShell 3.0, released in Windows 8, was updated to use the DLR.
IronScheme, a Scheme A scheme is a systematic plan for the implementation of a certain idea.
Scheme or schemer may refer to:
Arts and entertainment
* ''The Scheme'' (TV series), a BBC Scotland documentary series
* The Scheme (band), an English pop band
* ''The Schem ...
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
Trunk may refer to:
Biology
* Trunk (anatomy), synonym for torso
* Trunk (botany), a tree's central superstructure
* Trunk of corpus callosum, in neuroanatomy
* Elephant trunk, the proboscis of an elephant
Computing
* Trunk (software), in rev ...
, 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.
Architecture
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
Parrot was a register-based process virtual machine designed to run dynamic languages efficiently. It is possible to compile Parrot assembly language and Parrot intermediate representation (PIR, an intermediate language) to Parrot bytecode and ...
(with no dependencies) or Da Vinci Machine (built on Java's JVM
A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describes ...
by adding new bytecodes in the JVM instruction set), the DLR is built on top of the existing Common Language Runtime
The Common Language Runtime (CLR), the virtual machine component of Microsoft .NET Framework, manages the execution of .NET programs. Just-in-time compilation converts the managed code (compiled intermediate language code) into machine instructio ...
, the .NET Framework
The .NET Framework (pronounced as "''dot net"'') is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. It was the predominant implementation of the Common Language Infrastructure (CLI) until bein ...
virtual machine.
See also
* Da Vinci Machine – a project starting at Sun Microsystems which brought support for dynamic languages to the Java Platform at the Java virtual machine (JVM) level
* Parrot virtual machine
Parrot was a register-based process virtual machine designed to run dynamic languages efficiently. It is possible to compile Parrot assembly language and Parrot intermediate representation (PIR, an intermediate language) to Parrot bytecode and ...
References
*
*
*
*
*
*
External links
*
*
{{Microsoft FOSS
.NET terminology
Free and open-source software
Microsoft application programming interfaces
Microsoft free software
Software using the Apache license
2010 software