Hacker News new | ask | show | jobs
by johnzabroski 5614 days ago
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.

1 comments

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