Dynamic Language Runtime

Last updated
Dynamic Language Runtime (DLR)
Original author(s) Microsoft Dynamic Language Runtime Team
Developer(s) .NET Foundation
Initial releaseApril 16, 2010;13 years ago (2010-04-16)
Stable release
1.3.1 / December 2, 2021;18 months ago (2021-12-02) [1]
Repository github.com/IronLanguages/dlr
Written in C#
Operating system Windows, macOS, Linux (Debian, Ubuntu)
Platform Common Language Infrastructure
Type System platform
License Apache License 2.0
Website docs.microsoft.com/en-us/dotnet/framework/reflection-and-codedom/dynamic-language-runtime-overview

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:

Contents

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.

History

Microsoft's Dynamic Language Runtime project was announced by Microsoft at MIX 2007. [2] [3]

Microsoft shipped .NET DLR 0.9 beta in November 2008, [4] 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. [5] With the release of .NET 4, also in April 2010, DLR was incorporated into the .NET Framework itself. [6]

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. [7] [8] However, there has been regular activity since 2016/17, leading to a number of improvements and upgrades.

Language implementations

In 2007, Microsoft initially planned to use the DLR for the upcoming Visual Basic 2010 (VB 10.0) and Managed JScript (ECMAScript 3.0) as well as Python and Ruby. [2] [9] [10] [11] [12]

The DLR work on Ruby and Python resulted in IronRuby, a .NET implementation of the Ruby language, and IronPython. [2]

By August 2009, Microsoft had announced it had no more plans to implement Managed JScript on the DLR. [13] Fredrik Holmström later independently contributed a JavaScript implementation for the DLR which he dubbed "IronJS" in the naming tradition of IronPython and IronRuby.

Like C#, Visual Basic can access objects from dynamic languages built on the DLR such as IronPython and IronRuby. [14] [15]

PowerShell 3.0, released in Windows 8, was updated to use the DLR. [16]

IronScheme, a Scheme implementation, [17] 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. [18]

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. [19] 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. [20] 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. [21]

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. [22]

See also

Related Research Articles

In object-oriented programming, a class is an extensible program-code-template for creating objects, providing initial values for state and implementations of behavior. In many languages, the class name is used as the name for the class, the name for the default constructor of the class, and as the type of objects generated by instantiating the class; these distinct concepts are easily conflated. Although, to the point of conflation, one could argue that is a feature inherent in a language because of its polymorphic nature and why these languages are so powerful, dynamic and adaptable for use compared to languages without polymorphism present. Thus they can model dynamic systems more easily.

Visual Basic for Applications (VBA) is an implementation of Microsoft's event-driven programming language Visual Basic 6.0 built into most desktop Microsoft Office applications. Although based on pre-.NET Visual Basic, which is no longer supported or updated by Microsoft, the VBA implementation in Office continues to be updated to support new Office features. VBA is used for professional and end-user development due to its perceived ease-of-use, Office's vast installed userbase, and extensive legacy in business.

<span class="mw-page-title-main">Visual Basic (.NET)</span> Object-oriented computer programming language

Visual Basic (VB), originally called Visual Basic .NET (VB.NET), is a multi-paradigm, object-oriented programming language, implemented on .NET, Mono, and the .NET Framework. Microsoft launched VB.NET in 2002 as the successor to its original Visual Basic language, the last version of which was Visual Basic 6.0. Although the ".NET" portion of the name was dropped in 2005, this article uses "Visual Basic [.NET]" to refer to all Visual Basic languages released since 2002, in order to distinguish between them and the classic Visual Basic. Along with C# and F#, it is one of the three main languages targeting the .NET ecosystem. Microsoft updated its VB language strategy on 6 Feb 2023 stating that VB is a stable language now and Microsoft will keep maintaining it.

JScript is Microsoft's legacy dialect of the ECMAScript standard that is used in Microsoft's Internet Explorer 11 and older.

<span class="mw-page-title-main">Windows Script Host</span> Automation Technology for Windows

The Microsoft Windows Script Host (WSH) is an automation technology for Microsoft Windows operating systems that provides scripting abilities comparable to batch files, but with a wider range of supported features. This tool was first provided on Windows 95 after Build 950a on the installation discs as an optional installation configurable and installable by means of the Control Panel, and then a standard component of Windows 98 and subsequent and Windows NT 4.0 Build 1381 and by means of Service Pack 4. The WSH is also a means of automation for Internet Explorer via the installed WSH engines from IE Version 3.0 onwards; at this time VBScript became means of automation for Microsoft Outlook 97. The WSH is also an optional install provided with a VBScript and JScript engine for Windows CE 3.0 and following and some third-party engines including Rexx and other forms of Basic are also available.

JScript .NET is a .NET programming language developed by Microsoft.

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 was released on December 10, 2008. After version 1.0 it was maintained by a small team at Microsoft until the 2.7 Beta 1 release. Microsoft abandoned IronPython in late 2010, after which Hugunin left to work at Google. The project is currently maintained by a group of volunteers at GitHub. It is free and open-source software, and can be implemented with Python Tools for Visual Studio, which is a free and open-source extension for Microsoft's Visual Studio IDE.

A foreign function interface (FFI) is a mechanism by which a program written in one programming language can call routines or make use of services written or compiled in another one. An FFI is often used in contexts where calls are made into binary dynamic-link library.

In Microsoft Windows applications programming, OLE Automation is an inter-process communication mechanism created by Microsoft. It is based on a subset of Component Object Model (COM) that was intended for use by scripting languages – originally Visual Basic – but now is used by several languages on Windows. All automation objects are required to implement the IDispatch interface. It provides an infrastructure whereby applications called automation controllers can access and manipulate shared automation objects that are exported by other applications. It supersedes Dynamic Data Exchange (DDE), an older mechanism for applications to control one another. As with DDE, in OLE Automation the automation controller is the "client" and the application exporting the automation objects is the "server".

Phalanger is a compiler front end for compiling PHP source code into CIL byte-code, which can be further processed by the .NET Framework's just-in-time compiler. The project was started at Charles University and is supported by Microsoft. Phalanger was discontinued in favor of the more modern PeachPie compiler, which utilizes the Roslyn API.

<span class="mw-page-title-main">Microsoft Silverlight</span> Application framework for writing and running rich Internet applications

Microsoft Silverlight is a discontinued application framework designed for writing and running rich internet applications, similar to Adobe's runtime, Adobe Flash. A plugin for Silverlight is still available for a very small number of browsers. While early versions of Silverlight focused on streaming media, later versions supported multimedia, graphics, and animation, and gave support to developers for CLI languages and development tools. Silverlight was one of the two application development platforms for Windows Phone, but web pages using Silverlight did not run on the Windows Phone or Windows Mobile versions of Internet Explorer, as there was no Silverlight plugin for Internet Explorer on those platforms.

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 typing and dynamic method dispatch, among other things, for dynamic languages.

<span class="mw-page-title-main">Jim Hugunin</span>

Jim Hugunin is a software programmer who created the Python programming language extension Numeric, and later created Python implementations for the Java Platform (Jython) and for Microsoft .NET platform (IronPython); he has also co-designed the AspectJ extension for the Java programming language. He worked for Microsoft from 2004 to 2010, mainly on IronPython and Dynamic Language Runtime.

<span class="mw-page-title-main">TestComplete</span> Software test automation tool

TestComplete is a functional automated testing platform developed by SmartBear Software. TestComplete gives testers the ability to create automated tests for Microsoft Windows, Web, Android, and iOS applications. Tests can be recorded, scripted or manually created with keyword driven operations and used for automated playback and error logging.

IronScheme is an implementation of the Scheme programming language targeting the Microsoft .NET Framework. IronScheme is a complete rewrite of IronLisp, incorporating lessons learnt while developing IronLisp.

<span class="mw-page-title-main">.NET Framework</span> Software platform developed by Microsoft

The .NET Framework 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 being superseded by the cross-platform .NET project. It includes a large class library called Framework Class Library (FCL) and provides language interoperability across several programming languages. Programs written for .NET Framework execute in a software environment named the Common Language Runtime (CLR). The CLR is an application virtual machine that provides services such as security, memory management, and exception handling. As such, computer code written using .NET Framework is called "managed code". FCL and CLR together constitute the .NET Framework.

Microsoft Silverlight is an application framework for writing and running rich web applications that was actively developed and marketed by Microsoft from 2007 to 2012. This is a technical overview of the platform's history.

References

  1. "Releases". IronLanguages/dlr. GitHub . Retrieved 2022-01-27.
  2. 1 2 3 Hugunin, Jim. "A Dynamic Language Runtime (DLR)" . Retrieved 2007-06-21. 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.
  3. Viehland, Dino (2008-01-15). "Roadmap for IronPython 2.0". Archived from the original on 2008-09-06. Retrieved 2008-02-09. 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.
  4. "CodePlex Archive".
  5. "CodePlex Archive". Archived from the original on 2011-08-14. Retrieved 2010-07-27.
  6. "Dynamic Language Runtime Overview - .NET Framework".
  7. "Microsoft Tires of IronRuby; Jimmy Schementi Jumps Ship". rubyinside.com. 2010-08-07. Retrieved 2012-02-26. 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.
  8. "Microsoft's Dynamic languages are dying". i-programmer.info. 2010-08-10. Retrieved 2012-02-26. 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.
  9. "Managed JScript announced" . Retrieved 2007-05-04.
  10. "What the heck is "VBx"?". 2007-05-01. Archived from the original on 2009-05-25. Retrieved 2009-08-12. With the new DLR, we have support for IronPython, IronRuby, Javascript, and the new dynamic VBx compile
  11. "Putting Mix, Silverlight, the CoreCLR and the DLR into context". 2007-05-01. Retrieved 2008-08-12.
  12. "Introducing Visual Basic 10". infoq.com. 2007-05-04. Retrieved 2009-08-12. VB 10 takes advantage of a Silverlight feature called the Dynamic Language Runtime or DLR
  13. Chiles, Bill (2009-06-01). "Future of Managed JScript (IronJScript)?". Archived from the original on 2009-08-31. Retrieved 2009-08-12. 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.
  14. "What's New in Visual Basic 2010". Microsoft. 2009. Retrieved 2009-08-12. Visual Basic binds to objects from dynamic languages such as IronPython and IronRuby
  15. "Walkthrough: Creating and Using Dynamic Objects (C# and Visual Basic)".
  16. "PowerShell 3 – Finally on the DLR!". Archived from the original on 2012-04-28. Retrieved 2012-03-30.
  17. "CodePlex Archive".
  18. "Is there any silverlight sample?". 2009-05-11. Archived from the original on January 19, 2013. Retrieved 2009-07-26. 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
  19. Hugunin, Jim (2007-05-15). "DLR Trees (Part 1)" . Retrieved 2008-02-23. 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.
  20. Nutter, Charles (2008-01-28). "Lang.NET 2008: Day 1 Thoughts" . Retrieved 2008-02-23. 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.
  21. Bill Chiles (October 2007). "CLR Inside Out: IronPython and the Dynamic Language Runtime". MSDN Magazine. Retrieved 2007-08-10.
  22. Rose, John (2008-02-02). "Bravo for the dynamic runtime!". Archived from the original on 2008-02-06. Retrieved 2008-02-23. 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.