R – How does the DLR work

dynamic-language-runtimenet

.Net 4 will have the a DLR (Dynamic Language Runtime). I know that it will be used for things like Iron Python and Iron Ruby. But is that all it's good for?

How is the DLR useful?

How does the DLR work?

Best Answer

It is useful for allowing developers to build a dynamic language more easily, compatibility between a dynamic language and CLR and dynamic languages(built on the DLR) with each other.

The DLR is built on top CLR and as such you will be able to access other .Net libraries. Multiple language support enables you to pick the right language for the right task. The DLR allows developers to more easily create your own dynamic language (which I think is a lot of developers dream)

It works by using Dynamic Code Generation(code generation at run time) Dynamic Type System(Change type at runtime and allow DLR languages to have a common communication platform) Dynamic Method Dispatch(Dynamic dispatching is dynamically being able to change which code executes for a method at runtime).

Basically the DLR dynamically generates code based off the expression tree. The expression tree is a list actions that is being sent to the DLR to compile and run.

I think the DLR is going to be a game changer. After the DLR is released I think you are going to see a bunch of new languages springing up as well as more ports of existing languages.