AW: [Mono-devel-list] Compiler thoughts, 2

Miguel de Icaza miguel at ximian.com
Thu Mar 17 13:31:50 EST 2005


Hello,

> just as a matter of interest. What are the annoying limitations of
> Reflection.Emit?

Am replying to this in public, because this is actually a good example
of the point I was making about the maturity of an API.

Reflection.Emit seems to have been driven internally at Microsoft by
JScript and their regexp compiler.  As such, it is lacking some features
that are required for other languages.

There are two kinds of problems: missing functionality, or annoying
functionality.   The missing functionality we discovered as we
implemented the C# compiler on top of it, some of the issues that I
remember from the top of my head (but you can find more if you grep for
"Invoke" in the source code of the compiler) are: lacks functionality to
track the ModOpt and ModReq type qualifiers, to find the Volatile bits
on a field, to flag a local variable as a "pinned" variable, support for
resource embedding (one special case, read the source for the details).

Then there are annoying things like the *Builder family of methods track
information that is useful, but you get an exception if you call those
methods before you "create" the types.  The information is readily
available, but the API just refuses to give it you, so we had to create
a parallel universe to track the information ourselves.

Miguel.



More information about the Mono-devel-list mailing list