[Mono-list] Mono with other languages
jonpryor at vt.edu
Mon Feb 11 10:01:49 EST 2008
On Mon, 2008-02-11 at 10:40 +0000, Dan Smithers wrote:
> Jonathan Pryor wrote:
> > So the only real questions are:
> > 1. What language do you want to use?
> C++, Python
> > 2. Does that language have a compiler that runs on Linux?
> several - I would probably use gcc for C++.
gcc doesn't support C++/CLI. Additionally, gcc doesn't (at this time)
support generating IL.
> I suppose I should explain a bit about what I'm trying to achieve.
> We have core software developed under Linux, that we are hoping to make
> accessible to Windows developers across a network. We are planning to do
> this using network communication and also by exposing parts of the core
Are these actual C/C++ dynamic (not static) libraries, or C/C++
If these are dynamic libraries, you can write a C wrapper API, then
use .NET Platform Invoke to write a set of wrapper classes that invoke
the wrapper. Alternatively, you can use SWIG to generate the C and C#
wrappers that would be needed to interact with your C++ API:
Once the wrapper layer is written & compiled, any managed language will
be able to run against the wrapper layer, and (indirectly) use your
libraries. Examples of this approach include Mono.Posix.dll and Gtk#.
If this is a C/C++ program, you can use Mono's embedding interface so
that your program acts as a host for managed code, and then you can
provide "internal calls" so that managed code can invoke your exported
Second Life is embedding mono to run their scripting engine:
> To do this I want to provide an interface that can be used from Windows
> (i.e. .Net) platforms and implemented in an agnostic way. Mono seems a
> natural choice for this, but I am getting rather frustrated by C#.
The "shared libraries + P/Invoke" approach will work across both Mono
and .NET, while the "embedding mono" approach is tied to Mono.
More information about the Mono-list