Using the DLR for (primarily) static language compilation
Asked Answered
J

1

8

I'm building a compiler that targets .NET and I've previously generated CIL directly, but generating DLR trees will make my life a fair amount easier. I'm supporting a few dynamic features, namely runtime function creation and ducktyping, but the vast majority of the code is completely static.

So now that that's been explained, I have the following questions:

  • Has the DLR been used for static compilation, outside of small examples on MSDN blogs?
  • If so, what sort of performance was achieved?
  • If not, is there anything fundamentally preventing this?
  • Are there any better mechanisms of generating code than either using the DLR or emitting IL directly?

Any insight into this or references to blogs/code/talks would be greatly appreciated.

Julietajulietta answered 13/9, 2008 at 10:58 Comment(0)
O
7

I'm not aware of anyone using the DLR in quite this fashion yet, though this is definitely one of its intended use cases. One interesting thing to consider is that the DLR's expression trees have been merged with LINQ expression trees, so the IL being produced for LINQ in some as-yet-unannounced future version of Visual Studio will be using the DLR code.

A neat aspect of releasing the DLR as open source is that we have no idea what kinds of interesting things people outside the company might be doing with it :).

Oxus answered 13/9, 2008 at 13:30 Comment(1)
Thanks for your response, I've started building some static compilation prototypes, so we'll see how things go :) I will say, I wasn't expecting a response from someone at MS on a fairly obscure site -- good to see :)Julietajulietta

© 2022 - 2024 — McMap. All rights reserved.