I am the author of Boost.Proto, and I just recently discovered C # expression trees. AFAICT, they are similar in intentions, but different both in implementation and in scope.
C # has language support for capturing a LINQ expression as a dynamically typed tree. This is used by LINQ consumers to optimize query scores. A query against an in-memory data structure would be a simple assessment using LINQ extension methods, but one would be more optimally executed using a LINQ expression at run time, evaluating a T-SQL string and passing it to the SQL server for remote execution. As of now, C # expression trees are best suited for such optimization tasks.
Boost.Proto OTOH has a slightly wider coverage. Proto expression trees are statically typed, which allows complex transformations and code generation at compile time. More importantly, Proto provides tools for introspecting and transforming trees and creating custom code from them. This may be useful for optimization, but also for providing expressions of completely different subject semantics. Therefore, Proto is more accurately perceived as an integrated set of tools for specific languages.
The same could be done with C # expression trees, but AFAIK there is currently no infrastructure for tree conversion and code generation. The ability to generate runtime code on .NET makes this feature compelling. Maybe some entrepreneurial developer (you?) Would be ready to write Proto # on top of C # expression trees. :-)
source share