ArticleslgStudy

computer science

Dynamic Language Runtime

Dynamic Language Runtime is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Dynamic Language Runtime rather than just read about it. In short: 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: 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, including the IronPython an…

Key takeaways

  • Dynamic Language Runtime belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Dynamic Language Runtime to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Dynamic Language Runtime from memory before moving on to harder problems.

Reference excerpt

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:

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, 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. 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.

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. The DLR work on Ruby and Python resulted in IronRuby, a .NET implementation of the Ruby language, and IronPython. By August 2009, Microsoft had announced it had no more plans to implement Managed JScript on the DLR. 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. 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.

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 (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.

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

References

External links

Dynamic Language Runtime Overview dlr on GitHub

Worked examples

Example 1 — a first encounter with Dynamic Language Runtime

Start with the simplest possible case. Write down what Dynamic Language Runtime claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Dynamic Language Runtime before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Dynamic Language Runtime ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Dynamic Language Runtime

In research
Dynamic Language Runtime appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Dynamic Language Runtime in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Dynamic Language Runtime is common in secondary-school and first-year university syllabi. It links to neighbouring topics .NET terminology, 2010 software, Microsoft application programming interfaces, so understanding it makes those chapters shorter.
In everyday life
Look for Dynamic Language Runtime outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Dynamic Language Runtime” →

How to study Dynamic Language Runtime in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Dynamic Language Runtime means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Dynamic Language Runtime out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Dynamic Language Runtime in simple terms?

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: A dynamic type system, to be shared by all languages using the DLR services Dynamic method dispatch Dynamic code…

Why does Dynamic Language Runtime matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Dynamic Language Runtime?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Dynamic Language Runtime.

Tags

  • .NET terminology
  • 2010 software
  • Microsoft application programming interfaces
  • Microsoft free software
  • Software using the Apache license

Keep exploring