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

virgile.bello at free.fr virgile.bello at free.fr
Fri Jan 5 13:15:49 EST 2007



Hi again,

Finally I think I fixed most of my issues.

> 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).

1/ and 2/ are done by embedding and running mcs.exe with embedded mono (which
isn't that big finally) and generating .cs on the fly from monobind
definitions.
At end of project (when script doesn't change a lot), it could be all statically
generated, or even split from the beginning.

> 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).

4/ I was currently writting an embedded debugger for embedded mono. Not finished
yet but I think everything should be doable. It should be easy to make it able
to do remote debugging.

With all that, I think mono could be a very nice scripting solution.

Cordially,
Virgile Bello

> Hi,
>
> 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
> language.
> 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