[Mono-list] C/C++ Compiler for Mono environment?

Miguel de Icaza miguel at ximian.com
Thu Dec 29 11:12:04 EST 2005


Hello,

> I've googled, but I don't find any info on C or C++ compilers that 
> target the CLR.  I did find a couple of partial results, but nothing 
> that actually seems to work.
> 
> Is there a working C/C++ Compiler for Mono?   (Other than MSFT VS)

There is the "lcc" compiler, a full ANSI C compiler which has a CIL
backend, but it is limited to C.

The ideal path to support C++ is to finish the work that was started by
Jey on the summer of code to make GCC emit CIL code.   You can get some
links to the work-in-progress from:

	http://www.mono-project.com/Summer2005#GCC_CIL

The blog linked there has some details about the progress so far.

Once this stage is done, there are two extra stages that are fairly
complex:

	* Add Managed C++ support to the C++ front-end (this is 
	  required if you want to share objects between .NET and
	  C++)

	* Add the necessary data to pass the extra information
	  to the backend so that the metadata is preserved.

Each one of these three tasks are probably six months of work each.

Given the complexity of C++ this is really the only choice, implementing
a new C++ compiler just to support the CIL is not realistic. 

My team at Novell is not likely going to work on these things as we have
too many other things to do, but someone should pick up the work from
Jey.

Alternatively, you could use Microsoft's C++ compiler and then we could
make sure that all of the bits it requires are present in Mono.

Miguel


More information about the Mono-list mailing list