[Mono-dev] Mixed Mode Assemblies

Robert Jordan robertj at gmx.net
Fri Jul 22 05:49:10 EDT 2011


On 22.07.2011 00:56, Ivo Smits wrote:
> 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.

This is kinda obvious :) The same in C++ would be taking
like 10 times more effort. Tom was rather focused on the
unmanaged part in his PoC.

To be really useful, the generator must perform much more than
dumb stub generation. It must generate C++ classes, take care
of object pinning and unpinning, wrapping and
unwrapping C++ objects to/from Mono objects on managed/unmanaged
boundaries, struct handling, fields, constants, delegates,
exception handling, etc.

On the other hand, this is actually the duty of a C++ compiler
that claims to support managed extensions. So the next natural
step would be to check what others have already done it this area.

And... I have no idea where to start looking :) This is written
from memory:

There is a gcc C++/CIL, but it's of no use in our context
because it's got a CIL backend. I don't know if it supports
the managed C++ extensions syntax at all.

There is a (GSoC?) project focused on COM-like interop.
I don't know it they have something like a generator for
C++ stubs. If yes, it would be an IDL-approach, tailored for COM.

There is an interesting (GSoC?) project (maybe the same as
above?) focused on invoking those highly mangled C++ symbols
from unmanaged C++ libraries. This is rather the inverse of
what we've discussed so far in this thread, but it's
something worth looking at.

Robert



More information about the Mono-devel-list mailing list