Reputation: 84550
Eric Lippert has said on the record here at SO,
Reflection.Emit is too weak to use to build a real compiler. It's great for little toy compilation tasks like emitting dynamic call sites and expression trees in LINQ queries, but for the sorts of problems you'll face in a compiler you will quickly exceed its capabilities. Use CCI, not Reflection.Emit.
I've got a real compiler that was unfortunately built (not by me) on Reflection.Emit. It's butting up against those limits painfully, and I'd like to convert the emit code over to CCI. I'm finding a few things that there doesn't seem to be any equivalent for, though.
For example, the lines:
_asmBuilder.DefineVersionInfoResource();
_moduleBuilder.CreateGlobalFunctions(); //setup global .data
I don't see any way to do the same things, especially as I can't find any equivalent to ModuleBuilder in the first place.
Is there any good reference or documentation available for how to convert a Reflection.Emit project over to CCI?
Upvotes: 3
Views: 85