[Mono-list] Monobind: a C++ mono scripting library

virgile.bello at free.fr virgile.bello at free.fr
Thu Jan 4 05:47:16 EST 2007


Just in case you're interested, I post here the work I did latest days on
writing a "monobind" library (luabind/boost::python-alike library to bind C++
code to C# and C# to C++). It allows C++ code to calls C# as a scripting
It's very alpha atm, but it should work (tested on Win32 platform).
I included a sample test and modified mono source, which I had to modify in
order to deduce function arguments (which required passing another argument to
the generated callback function, check the post on my site about that ; btw I'm
not sure on the changes I done in case of a 64 bit platform).

You can check all that at http://dev.kalimdor.org/entropia ; monobind.zip is
attached to the first post.

Now, I have though of some problems about using C# as an embedded script
language :
1/ No compile on the fly, would require embedding mcs itself... Do you think
it's a good idea ?
2/ .cs files has still to be generated with InternalCall properties everywhere.
Of course it could be generated on the fly from the C++ bindings. Nevertheless
combined with #1, autogeneration would be nice (.cs are generated before
invokation of internal mcs, therefore it doesn't require the .cs to be coded).
3/ On the fly changements... Seems hard to recompile a single function in a
class (tho I think it should be doable).
4/ Debugging support for embedded mono isn't perfect... Ability to trace from
visual studio or from a remote debugger seems impossible (as I understood, the
mono debugger is for real .net executable, not embedded mono).

If you have any ideas on how to circumvent these issues, don't hesitate to
explain me.

Thanks to all of you !

Virgile Bello

More information about the Mono-list mailing list