Showing posts with label Dynamic Programming. Show all posts
Showing posts with label Dynamic Programming. Show all posts

Saturday, December 20, 2014

Dynamic Programming

1. What is Dynamic Language Runtime (DLR)?
DLR is a runtime environment that allows you to integrate dynamic languages with the Common Language Runtime (CLR) by adding a set of services, such as expression trees, call site caching, and dynamic object interoperability to the CLR.

The System.Dynamic and System.Runtime.CompilerServices namespaces are used to hold the classes for DLR. It also provides dynamic features to statically-typed languages, such as C# and Visual Basic to enable their interoperation with dynamic languages.


2. What are the advantages of DLR?
The various advantages provided by DLR are:
  • Allows you to easily implement the dynamic languages to the .NET Framework.
  • Provides dynamic features to statically-typed languages. The statically-typed .NET Framework languages, such as C# and Visual Basic can create dynamic objects and use them together with statically-typed objects.
  • Implements sharing of libraries and objects, which means that the objects and libraries implemented in one language can be used by other languages using DLR. The DLR also enables interoperation between statically-typed and dynamic languages.
  • Enables fast execution of dynamic operations by supporting advance caching.

3. Give a brief introduction to Binders.
Binders are used by DLR to communicate with not the .NET Framework but also with various other services, such as Silverlight and COM. These services represent language-specific semantics and specify how a particular operation can be performed at the call site.

Call sites refer to the area in the code where logical and mathematical operations, such as a + b or a.b() are performed on dynamic objects.