what is the Advantage of DLR in Silverlight?
What is the advantage of D开发者_StackOverflowLR
in Silverlight
?
Silverlight enables the Dynamic Language Runtime to bring language choice to the modern browsers, and in turn gives Silverlight developers an interactive environment for making them more productive
This allows you to quickly write HTML or Silverlight graphics based web applications, in any development environment, with powerful scripting languages.
In addition to C# and VB.NET, Silverlight applications can also be written in programming languages built using the Dynamic Language Runtime (DLR), like Ruby and Python.
article : Dynamic Languages in Silverlight
about performance : DLR and Performance
From WikiPedia: http://en.wikipedia.org/wiki/Dynamic_Language_Runtime
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.[13] 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.[14] 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.
精彩评论