tags:

views:

78

answers:

1

I've been playing with Reflection.Emit() to build some assemblies. I'm curious if this approach is used by the shipping compilers. The compiler exe's don't appear to be managed code, so this leads me to suspect that they're writing the IL direct to disk.

Do they:

  • use Reflection.Emit()
  • write the assemblies out using low level file commands
  • something else?
+3  A: 

Neither csc.exe not vb.exe use Reflection.Emit to emit managed code for the obvious reason that they are not written in managed code.

F# compiler is written in managed code. It uses its own IL writer backend to output IL assemblies. F# compiler however also sports an Reflection.Emit backend that is used in F# Interactive (REPL for F#).

IronPython and IronRuby compilers use Reflection.Emit to some extent I believe.

Mitya