Re:.NET Reflector no longer a free tool - An open letter to ...
by johnzabroski on Wednesday February 02, 2011 @11:18AM
(#2170755)
I could be interested in building a Reflector clone if somebody would write an F# plug-in to the project. I would probably start with looking at the CCI-Metadata project on Codeplex, and the Microsoft Phoenix compiler framework. Mono has similar libraries, but I only know a very small subset of Mono.Cecil API.
Cheers, Z-Bo
Re:.NET Reflector no longer a free tool - An open letter to ...
by timrobinson on Wednesday February 02, 2011 @12:17PM
(#2171027)
I did look into cloning Reflector when Red Gate originally acquired it. The work involved looks similar to that needed to build a .NET compiler, but in reverse. That is, you take a low-level machine representation; then build up a control flow graph; then map that control flow graph onto common high-level constructs such as if statements and for loops.
Re:.NET Reflector no longer a free tool - An open letter to ...
by johnzabroski on Wednesday February 02, 2011 @01:46PM
(#2171466)
I'm very familiar with engineering compilers and de-compilers. Have you seen Microsoft Phoenix? It lets you sink/hoist intermediate representations; the key for this would be having an API that allows ordering graph rewriting rules so that you can take the MSIL and convert it the right higher-level form (e.g., should this use LINQ? Well, what does the app settings say the user wants to see the code as?). Anyway, since Reflector is written in C#, it would be able to develop a clone much faster using code generation, since I bet Reflector uses a ton of Visitor patterns and needless C# boilerplate.
I won't promise performance comparable to Redgate's Reflector, but my rule of thumb is Correct. Clear. Fast. In that order.
Re:.NET Reflector no longer a free tool - An open letter to ...
by timrobinson on Wednesday February 02, 2011 @01:58PM
(#2171531)
I hadn't seen Phoenix before reading your comment, but I like the look of it. Looks useful for general compiler tinkering.
When I looked at this a while back, I was trying to do it in C# on Mono.Cecil. I got bogged down writing things like CSharpWhileLoopVisitor...
Re:.NET Reflector no longer a free tool - An open letter to ...
by quag on Wednesday February 02, 2011 @05:54PM
(#2172619)
Reflector uses Mono's Cecil. It ships with a copy of the Cecil license.
Re:.NET Reflector no longer a free tool - An open letter to ...
by johnzabroski on Thursday February 03, 2011 @01:11PM
(#2175831)
Thank you very much for that tidbit.
For instance, Red Gate recently added an F# mode, which essentially doesn't work. If Reflector had been open source and free, I'd have been willing to get this feature running. The benefit I'd derive from a working F# mode would likely make the effort worthwhile.