views:

332

answers:

1

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.

+6  A: 

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 :).

Curt Hagenlocher
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 :)
Cody Brocious