[Mono-dev] Mixed Mode Assemblies

Tom Spink tspink at gmail.com
Fri Jul 22 13:57:02 EDT 2011


Hi Ivo,

On 21 July 2011 23:56, Ivo Smits <Ivo at ufo-net.nl> wrote:
>
> That doesn't give the full power of Mixed Mode assemblies, but I think
> it's definitely an interesting approach with many potential uses.
> Especially, I think, when replacing existing libraries or building
> plugins or extensions for existing software.


Absolutely - something, as I've mentioned, I think needs to be done at the
compiler level.


> I would rather skip the rewriting, and just start with a simple 'if
> (!initialized) initialize();' and leave the code unpatched. Doesn't cost
> much (especially considering the rest of the code) and works independent
> of the compiler/platform.
>

I just /hate/ unnecessary tests, and the test will ONLY be valid once, then
it's just extra overhead.  I've implemented a form of runtime code patching,
in the current source - but since it's very much x86-32 specific, it could
be turned off for other architectures, and a simple test with hard-coded
branch predictions built in could be used instead.  Bear in mind, this code
is platform specific anyway - it's native!


> What happens if either the namespace or class name contains dots? Are
> they converted to underscores? Also, I think it might be interesting to
> be able to override these generated names, perhaps using (custom) code
> attributes, to help in replacing or implementing existing libraries,
> plugins, ... Attributes might also be useful to specify how variables
> should be marshaled.
>

Well, currently, there is no generator - so that's completely open for
discussion!  I love the idea of attributes to assist the generator, and
marshalling hints would definitely be helpful.


> Also, I think that eventually the 'reverse interop code' could be
> generated from an assembly file by using the Reflection framework. You
> could make the code generator a managed application.
>

Oh without a doubt!  It would too much of a duplication of effort to go
around parsing the metadata tables.  I wrote a simple PE/CLI parser as an
exercise (to keep me occupied one Friday night!) and parsing those tables is
just rotten!

Ivo


-- Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110722/da93da9e/attachment.html 


More information about the Mono-devel-list mailing list