Implementing a new language

I was looking into adding support to compile c# (in a limited subset with manual memory handling) into clang but i have no idea where to start. I would like to be able to make it interact with c++/c code thus using clang.

Is this doable with clang in its current state?
Where should i begin?

Mark

I was looking into adding support to compile c# (in a limited subset with manual memory handling) into clang but i have no idea where to start. I would like to be able to make it interact with c++/c code thus using clang.

Is this doable with clang in its current state?
Where should i begin?

clang supports objective-c/objective-c++ which is the superset of c/c++. You can start by looking at how clang implements it.
There are test cases in clang test directory (.m for objc .mm for objective-c++). Use -ast-dump to dump AST nodes for objc features, etc.

- fariborz

Do you really think this is a good idea? C# is a very different language from C and C++, despite superficial similarities. Also, the language is not really designed to cope with manual memory management, and would be quite complicated to use in such a context. (Not that this has much to do with the compiler itself anyway.)

I also don't quite understand your goal. What do you mean by interact? Do you also want to interact with real C#? Do you want to interact on the source level or the binary level?

Sebastian

As Sebastian says, C# is so different that reusing clang doesn't make much sense.
It may be of interest to you this project: http://code.google.com/p/gel2/
"Google Experimental Language #2 (GEL2) is an experimental general-purpose object-oriented programming language. GEL2 is essentially a subset of C#, extended with an ownership-based type system which allows GEL2 to free memory safely and deterministically without using a garbage collector."

-Argiris