Is DLR required in .NET 4.0?

I have studied the use of DLR for my toy language, and I'm a little confused. If .NET 4.0 has LINQ expression trees, dynamic objects, and a โ€œdynamicโ€ type, then do we really need DLR? What provides DLR, which will facilitate my life as a language developer.

--- Change ----

Let me explain my question a little better. Is the DLR project found on codeplex (dlr.codeplex.com) more needed for this? Are all the features of this DLR project included in .NET 4? Or is there something valuable that can be found in DLR?

+7
source share
4 answers

This will not quite answer your question, but I was very interested in reading Jim Hyugunin's message about leaving Microsoft some time ago.

One of the things he pointed out was that DLR was the driver of the many good achievements that we have in .Net 4.0 that you are saying right now are the reason that you no longer need DLR.

Edit: Messsage link - http://hugunin.net/microsoft_farewell.html

On the other hand, I think the DynamicSite system is still something very valuable, although not necessarily something important to host the CLR itself.

2nd edit: this is an interesting request, I just looked at the documents on Codeplex. As you state and clarify, CLR.NET 4.0 implements those things that were used to make DLR special; Reading the DLR review, I think the main idea is that things implemented with DLR have the advantage of gaining access to new features faster than waiting for a new version of the Framework.

This may be controversial as they have not released a new version of DLR for a while now!

Another possible advantage, but I admit that I did not investigate this correctly, is that the AST in DLR has more features:

Common AST (Expression Trees) - This is one of the main pillars of DLR. We have expanded LINQ expression trees to include flow control, assignment, etc. We also send sources for all expressions Trees v1 and v2 (new material for DLR). The Tres expression is part of reducing the bandwidth for porting languages โ€‹โ€‹to .NET, and we use them in the binding protocols and DynamicMetaObject.

+2
source

During the development of DLR, we divided it into two parts - the inner layer and the outer layer. The inner layer consisted of caching of the call site, extended expression trees, and the protocol of meta objects. All of this was intended for and was added in .NET 4.0.

The outer layer consisted of hosting APIs, an expression tree interpreter, support for interacting with COM, a custom overload recognizer for calling .NET methods, the default binding for most DLR operations, and many other various helpers. None of this was shipped with the .NET platform, but could be useful to you. When using this in .NET 4.0, it relies on the DLR API that ships with .NET 4.0.

The outer layer was also divided into two parts - hosting APIs (Microsoft.Scripting.dll) and everything else (Microsoft.Dynamic.dll). You can target DLR APIs if you want people to be able to host your language just like they have IronPython and IronRuby. And you could use Microsoft.Dynamic.dll or just extract useful code snippets from it, rather than reinvent the wheel. In any case, if you need the latest version, you will need to check out IronPython / IronRuby websites, as Microsoft is no longer actively developing the components of the outer layer.

+3
source

As this wiki page ( http://en.wikipedia.org/wiki/Dynamic_Language_Runtime ) shows, DLR is used with IronPython and IronRuby, so yes, this is still necessary.

This will simplify your life if you can use a more dynamic language for your development.

+1
source

Codeplex DLR is open source, so itโ€™s much easier to make improvements / additions to support the features that your language might require.

+1
source

All Articles