[Mono-devel-list] Does no one answer?
Jonathan Pryor
jonpryor at vt.edu
Thu Nov 20 07:45:33 EST 2003
The current Mono solution to your problem would be to flagrantly violate
the SPOT principal (Single Point Of Truth).
Mono's current solution is duplication: Mono has a C representation of
the basic types (such as System.String), and a C# representation of the
same type. These two representations must be kept in sync with each
other. The C# version uses internal calls to invoke into the runtime,
at which point the C representation is used.
A similar thing could be done with automating your app: you introduce
some internal calls (using mono_add_internal_call), which the C# version
of your classes can use.
As you can imagine, this can lead to a large amount of code duplication
if you want to wrap every C++ class.
One potential solution is to describe your common classes in XML, then
use XSLT to generate the C# and C++ type definitions. This would
simplify maintenance, at the cost of some tool complexity.
The only other alternative would be to implement a Managed C++
compiler. This probably isn't a good idea right now, as Microsoft wants
to change the language definition for Managed C++ (to something that
doesn't suck, I hope). Additionally, GCC can't target CIL (yet), so
you'd practically have to start from scratch for Managed C++.
So the simple choices right now consist of:
1. Ignoring the whole issue and not using mono for program automation
2. Manually maintaining duplicate class definitions for C++/C# classes
3. Writing & using a tool to generate the C++/C# classes
I can't think of any other alternatives, and I don't see the situation
changing anytime soon either. The current emphasis is on getting Mono
stable for a 1.0 release (Q1 2004), so there probably isn't much time to
do anything else.
- Jon
On Thu, 2003-11-20 at 04:13, ThorstenNRW wrote:
> I'm new to this mailing list.
>
> I posted two weeks ago the question if Mono can be used for automating
> a C++ application as can be done for example with JavaScript. This
> means I can declare and create objects in Mono which can communicate
> bi-directional with my C++ application. I also asked if anyone is
> willing to enhance Mono with me together in case this is not possible
> at present.
>
> I didn't receive any answers, but an answer is highly appreciated,
> because we must decide whether we will use Mono or JavaScript for
> automating our application. Of course we would prefer using Mono.
>
> Thank you.
>
> Regards
> Thorsten Radde
> IDEAL Software GmbH
>
> ============================
> http://www.IdealSoftware.com
> http://www.IdealSoftware.de
> ============================
>
More information about the Mono-devel-list
mailing list