Dynamic Language Runtime: Difference between revisions

Content deleted Content added
added some details on how it works, its very brief and will probably sound voodoo-ish to those who do not have prior experience, but hey, its just the start.
Bender the Bot (talk | contribs)
m Architecture: HTTP to HTTPS for Blogspot
 
(182 intermediate revisions by 83 users not shown)
Line 1:
{{betaInfobox software}}
| name = Dynamic Language Runtime (DLR)
{{Infobox Software
| logo =
| name = Dynamic Language Runtime
| screenshot =
| logo =
| caption =
| screenshot =
| author = [[Microsoft]] Dynamic Language Runtime Team
| caption =
| developer = [[Microsoft.NET Foundation]] Dynamic Language Runtime Team
| released = {{Start date and age|2010|04|16}}
| latest release version =
| latest release dateversion = {{wikidata|property|reference|edit|P548=Q2804309|P348}}
| latest release date = {{Start date and age|{{wikidata|qualifier|mdy|P548=Q2804309|P348|P577}}}}
| latest preview version =
| latest preview date =
| programming language = [[C Sharp (programming language)|C#]]
| operating system = Microsoft Windows
| operating system = [[Microsoft Windows|Windows]], [[macOS]], [[Linux]] ([[Debian]], [[Ubuntu (operating system)|Ubuntu]])
| platform = [[Microsoft .NET|.NET]]
| platform = [[Common Language Infrastructure]]
| genre = [[Platform (computing)|System platform]]
| genre = [[Platform (computing)|System platform]]
| license = [[Shared source#Microsoft Public License (Ms-PL)|Microsoft Public License]]
| license = [[Apache License 2.0]]
| website = {{URL|https://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 language]]s. These services include:
* A dynamic [[type system]], to be shared by all languages using the DLR services
* [[Dynamic dispatch|Dynamic method dispatch]]
* [[Runtime code generation|Dynamic code generation]]
* Hosting API
 
The DLR is used to implement dynamic languages on the [[.NET Framework]], including the [[IronPython]] and [[IronRuby]] projects.
The '''Dynamic Language Runtime''' (DLR) from [[Microsoft]] is a 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. These services include:
*A [[dynamic type]] system, to be shared by all languages utilizing the DLR services.
*[[Dynamic dispatch|Dynamic method dispatch]]
*[[Runtime code generation|Dynamic code generation]]
*Hosting API
 
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 [[Library (computing)|libraries]] from any dynamic language in any other dynamic language. In addition, the hosting API allows interoperability with statically typed [[list of CLI languages|CLI languages]] like [[C Sharp (programming language)|C#]] and [[Visual Basic .NET]].
It will be used to implement dynamic languages like [[Python (language)|Python]] and [[Ruby (language)|Ruby]] on the [[.NET Framework]]. The DLR services are currently used in the developement versions of [[IronRuby]], a .NET implementation of the Ruby language, and the upcoming [[IronPython]] 2.0.<ref name="announce">{{cite web
 
==History==
Microsoft's Dynamic Language Runtime project was announced by Microsoft at [[MIX (Microsoft)|MIX]] 2007.<ref name="announce" /><ref>{{cite web
|url = http://lists.ironpython.com/pipermail/users-ironpython.com/2008-January/006235.html
|title = Roadmap for IronPython 2.0
|last = Viehland
|first = Dino
|quote = ''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.''
|date = 2008-01-15
|access-date = 2008-02-09
|archive-url = https://web.archive.org/web/20080906190952/http://lists.ironpython.com/pipermail/users-ironpython.com/2008-January/006235.html
|archive-date = 2008-09-06
|url-status = dead
}}</ref>
 
Microsoft shipped .NET DLR 0.9 beta in November 2008,<ref>{{Cite web|url=http://www.codeplex.com/dlr|title=CodePlex Archive}}</ref> 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 [[Shared source#Microsoft Public License (Ms-PL)|Microsoft Public License]] to the [[Apache License 2.0]].<ref>{{Cite web|url=http://dlr.codeplex.com/license|title=CodePlex Archive|access-date=2010-07-27|archive-date=2011-08-14|archive-url=https://web.archive.org/web/20110814193029/http://dlr.codeplex.com/license|url-status=dead}}</ref> With the release of [[.NET 4]], also in April 2010, DLR was incorporated into the .NET Framework itself.<ref>{{cite web | url=https://msdn.microsoft.com/en-us/library/dd233052.aspx | title=Dynamic Language Runtime Overview - .NET Framework | date=30 March 2024 }}</ref>
 
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.<ref>{{cite web
| url = http://www.rubyinside.com/microsoft-tires-of-ironruby-jimmy-schementi-jumps-ship-3639.html
| title=Microsoft Tires of IronRuby; Jimmy Schementi Jumps Ship
| quote=''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.''
| publisher=rubyinside.com
| date = 2010-08-07
| access-date = 2012-02-26}}</ref><ref>{{cite web
| url = http://www.i-programmer.info/news/98-languages/1156-microsofts-dynamic-languages-are-dying.html
| title=Microsoft's Dynamic languages are dying
| publisher=i-programmer.info
| quote=''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.''
| date = 2010-08-10
| access-date = 2012-02-26}}</ref> 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 .NET#2010 (VB 10.0)|Visual Basic 2010 (VB 10.0)]] and [[JScript|Managed JScript]] ([[ECMAScript]] 3.0) as well as Python and Ruby.<ref name="announce"/><ref name="Managed JScript announced">{{cite web
| url = http://blogs.msdn.com/jscript/archive/2007/05/04/managed-jscript-announced.aspx
| title = Managed JScript announced
| access-date = 2007-05-04}}</ref><ref>{{cite web
| url = http://www.panopticoncentral.net/archive/2007/05/01/20383.aspx
| title = What the heck is "VBx"?
| date = 2007-05-01
| quote = ''With the new DLR, we have support for IronPython, IronRuby, Javascript, and the new dynamic VBx compile''
| access-date = 2009-08-12
| archive-date = 2009-05-25
| archive-url = https://web.archive.org/web/20090525130300/http://panopticoncentral.net/archive/2007/05/01/20383.aspx
| url-status = dead
}}</ref><ref>{{cite web
| url = http://www.hanselman.com/blog/PuttingMixSilverlightTheCoreCLRAndTheDLRIntoContext.aspx
| title = Putting Mix, Silverlight, the CoreCLR and the DLR into context
| date=2007-05-01
| access-date = 2008-08-12}}</ref><ref>{{cite web
| url = http://www.infoq.com/news/2007/05/VBx
| title = Introducing Visual Basic 10
| publisher=infoq.com
| date=2007-05-04
| quote=''VB 10 takes advantage of a Silverlight feature called the Dynamic Language Runtime or DLR''
| access-date = 2009-08-12}}</ref>
 
The DLR work on Ruby and Python resulted in [[IronRuby]], a .NET implementation of the [[Ruby (programming language)|Ruby]] language, and [[IronPython]].<ref name="announce">{{cite web
| url = http://blogs.msdn.com/hugunin/archive/2007/04/30/a-dynamic-language-runtime-dlr.aspx
|last=Hugunin|first=Jim
| title = A Dynamic Language Runtime (DLR)
|quote=''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.''
| accessdateaccess-date = 2007-06-21 }}</ref>
 
By August 2009, Microsoft had announced it had no more plans to implement Managed JScript on the DLR.<ref>{{cite web
Microsoft plans to use the DLR for the upcoming [[Visual Basic .NET#Visual Basic 'VBx' (VB 10.0)|Visual Basic .NET 10.0 (VBx)]] and [[JScript|Managed JScript]] ([[ECMAScript]] 3.0).
|url = http://dlr.codeplex.com/Thread/View.aspx?ThreadId=58121
|last = Chiles
|first = Bill
|title = Future of Managed JScript (IronJScript)?
|quote = ''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.''
|date = 2009-06-01
|access-date = 2009-08-12
|archive-date = 2009-08-31
|archive-url = https://web.archive.org/web/20090831184901/http://dlr.codeplex.com/Thread/View.aspx?ThreadId=58121
|url-status = dead
}}</ref> 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 Sharp (programming language)|C#]], Visual Basic can access objects from dynamic languages built on the DLR such as [[IronPython]] and [[IronRuby]].<ref>{{cite web
By having several dynamic language implementation share a common underlying system, it should be easier to let these implementations interact with one another. For example, it should be possible to use libraries in any dynamic language in any other dynamic language. In addition, the hosting API allows interoperability with statically typed [[.NET languages]] like [[C sharp (programming language)|C#]].
| url = https://msdn.microsoft.com/en-us/library/we86c8x2%28VS.100%29.aspx
| title = What's New in Visual Basic 2010
| year=2009
| publisher=[[Microsoft]]
| quote=''Visual Basic binds to objects from dynamic languages such as IronPython and IronRuby''
| access-date = 2009-08-12}}</ref><ref>{{cite web | url=https://msdn.microsoft.com/en-us/library/ee461504.aspx#Y480 | title=Walkthrough: Creating and Using Dynamic Objects (C# and Visual Basic) | date=25 February 2023 }}</ref>
 
[[PowerShell]] 3.0, released in [[Windows 8]], was updated to use the DLR.<ref>{{cite web |url= http://huddledmasses.org/powershell-3-finally-on-the-dlr |title= PowerShell 3 – Finally on the DLR! |access-date= 2012-03-30 |url-status=dead |archive-url=https://web.archive.org/web/20120428191707/http://huddledmasses.org/powershell-3-finally-on-the-dlr/ |archive-date= 2012-04-28 }}</ref>
The DLR defines a language-neutral [[Abstract Syntax Tree]], exposed via the [[.NET Framework]] [[object model]] that dynamic language compiler-front ends can compile to. DLR then [[.NET metadara#Reflection|dynamically generates]] methods that are invoked as required. It also provides a dynamically updated ''call site'' object that captures the dynamic state of the program. Method calls modify the state of this object, during execution.
 
[[IronScheme]], a [[Scheme (programming language)|Scheme]] implementation,<ref>{{Cite web|url=http://www.codeplex.com/IronScheme|title = CodePlex Archive}}</ref> was planning to build upon the DLR. This idea was abandoned because the DLR [[Branching (software)|branch]] used by the project became out of sync with the [[Trunk (software)|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.<ref>{{cite web
==History==
|url = http://ironscheme.codeplex.com/Thread/View.aspx?ThreadId=55925
Microsoft's Dynamic Language Runtime project was announced by Microsoft at [[MIX (Microsoft)|MIX]] 2007<ref name="announce" />. The DLR code currently lives in the [[IronPython]] repository. Microsoft plan to ship a first usable 1.0 version of the DLR at the same time as IronPython 2.0, by the end of [[2008]] <ref>{{cite web
|archive-url = https://archive.today/20130119115406/http://ironscheme.codeplex.com/Thread/View.aspx?ThreadId=55925
| url = http://lists.ironpython.com/pipermail/users-ironpython.com/2008-January/006235.html | title = Roadmap for IronPython 2.0
|url-status = dead
| last=Viehland |first=Dino
|archive-date = January 19, 2013
| quote=''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 its self the plan is to ship a v1.0 around the same time as IronPython 2.0.''
|title = Is there any silverlight sample?
| date = 2008-15-01
|quote = ''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''
| accessdate = 2008-02-09}}</ref>.
|date = 2009-05-11
|access-date = 2009-07-26
}}</ref>
 
==Architecture==
The Dynamic Language Runtime is built on the idea that it is possible to implement language specificities on top of a generic [[language-independent specification|language-agnostic]] [[Abstractabstract syntax tree]], whose nodes correspond to a specific functionality that is common to many dynamic languages.<ref>{{cite web
| url = http://blogs.msdn.com/hugunin/archive/2007/05/15/dlr-trees-part-1.aspx
| title = DLR Trees (Part 1)
Line 50 ⟶ 131:
| quote=''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.''
| date = 2007-05-15
| accessdateaccess-date = 2008-02-23}}</ref>. 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.<ref>{{cite web
| url = httphttps://headius.blogspot.com/2008/01/langnet-2008-day-1-thoughts.html
| title = Lang.NET 2008: Day 1 Thoughts
| last=Nutter|first=Charles
| quote=''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.''
| date = 2008-01-28
| access-date = 2008-02-23}}</ref> The DLR [[Metadata (CLI)#Reflection|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.
| accessdate = 2008-02-23}}</ref>.
 
The DLR provides dynamically updated <code>DynamicSite</code> 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. <code>DynamicSite</code> objects represent and cache the state of the object and its methods; any update to the object is reflected in the <code>DynamicSite</code> objects as well. DLR routes all method invocations via the <code>DynamicSite</code> objects, which then performs a fast lookup and [[name binding|binding]] of the method with the actual implementation.<ref>{{cite web | url = http://msdn2.microsoft.com/en-us/magazine/cc163344.aspx | title = CLR Inside Out: IronPython and the Dynamic Language Runtime | publisher = [[MSDN]] Magazine | author = Bill Chiles | date = October 2007 | access-date = 2007-08-10}}</ref>
In contrast to other efforts like [[Da Vinci Machine]] (which aim to add support for [[Dynamic programming language|dynamic languages]] in the core of the [[Java Virtual Machine]] (thus planning to add new bytecodes in the [[Java bytecode|JVM instruction set]], and new JVM capabilities), the DLR is built on top of the existing [[Common Language Runtime]], the [[.NET Framework]] virtual machine<ref>{{cite web
| url = http://blogs.sun.com/jrose/entry/bravo_for_the_dynamic_runtime
| title = Bravo for the dynamic runtime!
| last=Rose|first=John
| quote=''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.''
| date = 2008-02-02
| accessdate = 2008-02-23}}</ref>.
 
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 [[Java bytecode|JVM instruction set]]), the DLR is built on top of the existing [[Common Language Runtime]], the [[.NET Framework]] virtual machine.<ref>{{cite web
== Notes ==
|url = http://blogs.sun.com/jrose/entry/bravo_for_the_dynamic_runtime
|title = Bravo for the dynamic runtime!
|last = Rose
|first = John
|quote = ''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.''
|date = 2008-02-02
|access-date = 2008-02-23
|archive-url = https://web.archive.org/web/20080206064217/http://blogs.sun.com/jrose/entry/bravo_for_the_dynamic_runtime
|archive-date = 2008-02-06
|url-status = dead
}}</ref>
 
==See also==
{{Portal|Free and open-source software}}
* [[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]]
 
==References==
{{reflist}}
 
== References ==
{{refbegin}}
*{{cite web | url = http://blogs.msdn.com/somasegar/archive/2007/04/30/mix-07-silverlight-shines-brighter.aspx | title = MIX 07 - Silverlight shines brighter! | accessdateaccess-date = 2007-04-30}}
*{{cite web | url = http://sessions.visitmix.com/default.asp?event=1011&session=2012&pid=DEV02&disc=&id=1511&year=2007&search=DEV02 | title = MIX 07 Video Presentation - DEV02 - Just Glue It! Ruby and the DLR in Silverlight |access-date=2007-05-04 accessdate |archive-url=https://web.archive.org/web/20070508035633/http://sessions.visitmix.com/default.asp?event=1011&session=2012&pid=DEV02&disc=&id=1511&year=2007&search=DEV02 |archive-date=2007-05-0408 |url-status=dead }}
*{{cite web | url = http://blogs.msdn.com/hugunin/archive/2007/04/30/a-dynamic-language-runtime-dlr.aspx | title = "Jim Hugunin's Thinking Dynamic | A Dynamic language runtime (DLR) | accessdateaccess-date = 2008-02-06}}
*{{cite web | url = http://packages.debian.org/source/squeeze/dlr-languages | title = Details of source package dlr-languages in squeeze – DLR in Debian | access-date = 2010-07-06}}
*{{cite web | url = http://packages.ubuntu.com/source/lucid/dlr-languages | title = Details of source package dlr-languages in lucid – DLR in Ubuntu | access-date = 2010-07-06}}
*{{cite web | url = https://www.facultyresourcecenter.com/curriculum/7224-LangNET-Symposium-2008-–-ox-.aspx | archive-url = https://archive.today/20131208124054/https://www.facultyresourcecenter.com/curriculum/7224-LangNET-Symposium-2008-%E2%80%93-ox-.aspx | url-status = dead | archive-date = 2013-12-08 | title = Pratap Lakshman's o.x the Managed JScript Type System | access-date = 2008-01-28 }}
{{refend}}
 
==SeeExternal alsolinks==
{{Wikibooks|.NET Development Foundation}}
*[[Da Vinci Machine]], an ongoing effort to bring support for dynamic languages on the [[Java Platform]] at the [[Java Virtual Machine]] level.
*{{Official website|https://docs.microsoft.com/en-us/dotnet/framework/reflection-and-codedom/dynamic-language-runtime-overview|Dynamic Language Runtime Overview}}
*{{Github|https://github.com/IronLanguages/dlr}}
 
{{Microsoft-stub.NET Framework}}
{{Microsoft FOSS}}
 
[[Category:.NET terminology]]
[[Category:Free and open-source software]]
[[Category:Microsoft application programming interfaces]]
[[Category:.NETMicrosoft frameworkfree software]]
[[Category:Software using the Apache license]]
 
[[Category:2010 software]]
[[fr:Dynamic Language Runtime]]
[[ja:動的言語ランタイム]]
[[zh:Dynamic Language Runtime]]