RoslynLinqRewrite – Compiles C# by rewriting and optimising LINQ expressions
github.com
github.com
Effectively this transformation is the same as doing "Convert LINQ to code" and "Extract method" in R# (although those tend to sometimes be unable to codify even simple LINQ expressions).
It doesn't even look right for the example. This line:
num += num2 + 3;
Should be: num += _linqitems[i] + 3;The tool works fine, I've tried it out myself
int num2 = _linqitems[i];
from the decompiled output. I'm fairly certain that if the transformation wouldn't result in compiling code, the compiler would refuse to compile it, resulting in no assembly to decompile. They also noted somewhere to have run the System.Linq tests and only one edge case involving Min/Max and NaN failed. Tests likely wouldn't run either if the code didn't compile.BTW I cover this in my recent book: https://www.packtpub.com/mapt/book/Application%20Development...
You could try code samples and benchmarks: https://github.com/PacktPublishing/ASP.NET-Core-1.0-High-Per...
I guess this is for exactly the reasons you talk about, i.e. once it's working with Expression tress too much is unknown and any optimisations would be v. risky.
> No support for F#
Why is this? Is it a macro (as opposed to working with bytecode directly)?
[1] `The .NET Compiler Platform ("Roslyn") provides open-source C# and Visual Basic compilers with rich code analysis APIs.` - https://github.com/dotnet/roslyn