Earlier quoted context omitted.
As a student of compilers myself, it's my understanding that producing bytecode is as easy as--if not vastly easier than--producing code in another language, and that this is particularly true when the target language is high-level. The only exception to this I can envision is when the source language maps easily and completely to every single target language, in which case the source language must be the least commo…
> it's my understanding that producing bytecode is as easy as--if not vastly easier than--producing code in another language Maybe true for unoptimized code. However, Java and C# compilers have received years of work to make efficient use of their respective VMs; standing on their shoulders makes some sense.
You won't see the C# compiler inlining functions (even though the CLR does _way_ better with large functions and doesn't handle inlining well). It won't propagate constant expressions. You won't see it transforming recursive functions into loops. Does it even remove unused variables?
All the optimizations that C# really relies on for performance are handled by the JIT, and any compiler following the same patterns will get the same enhancements, plus the ability to emit better IL than C#.
That said, I'm still unconvinced it's easier to emit MSIL than C#, and I'm rather well versed with MSIL.