It's been over a week since we released IronPython 2.0 Beta 1 which also contains the Beta 1 version of DLR. The release includes several favorites of mine in the area of expression trees and compilation, mostly invisible to users of IronPython, but of interest to people developing a DLR based languages.

Unfortunately, the side effect of the release is that most of the samples I put out in the previous posts will no longer work. Even though the ideas remain, some things are shifting a little.

The main difference is probably that what we used to call, confusingly, a CodeBlock, is now called LambdaExpression, and the release sources were snapped right before a checkin went through which made LambdaExpression actually an expression. But don't despair, you can get that change as the latest bits on CodePlex already.

Moreover, to create a lambda expression, one must provide a delegate type. Much of the invisible changes I mentioned before were to ensure that the product of compilation of the LambdaExpression - a delegate - will actually match the signature of the LambdaExpression itself (when DLR deals with closures, it adds an extra parameter to lambdas to carry closures around). Now that the signature of the compiled delegate matches the signature of the lambda expression, the factory method for the LambdaExpression requires delegate, or tries to infer one from a small pre-defined set.

Along with this direction, we are really really close making the whole expression tree fully read only and within days we'll be there completely. Why does it make me so excited? Well, DLR, being a runtime, needs to deal with multi-threaded issues and read only structures don't suffer from threading problems. Also, it is a very sane programming model which guarantees that during compilation the producer of the tree hasn't changed his/her mind and, say, added a for loop somewhere, or changed lexical structure of the lambdas.

I think these are the main big items within the DLR itself, and there's much more coming. In the near future I will post some updated samples to show how to work with the new lambda expression object model and I will also start talking more about the 2nd half of the DLR - the dynamic operations, sites, caches and how all that fits together. We scratched the surface in some early posts, but we glossed over some interesting parts and left few things unexplained.

Until then, happy DLR hacking.