Reputation: 21508
I am looking for an option to compile C# syntax to native code (or maybe to C++?). I am not interested in having all the libraries that are officially part of the language, just being able to write programs the same as I write my C++ programs, but using language constructs such as partial classes, properties, lambdas, generics, etc.
Upvotes: 2
Views: 201
Reputation: 43046
The standard csc.exe compiler can compile without using the BCL. See the reference for the /nostdlib
switch: http://msdn.microsoft.com/en-us/library/fa13yay7.aspx
In part, it says:
"Use this option if you want to define or create your own System namespace and objects."
Silverlight projects use this, for example.
Upvotes: 0
Reputation: 37945
Possibly the closest thing to what you want is the Vala programming language. It is heavily inspired by C# and compiles to C, which is then compiled by a traditional C compiler.
It has partial classes, properties, lambdas, generics, etc, as you say, but it's not C#.
Also check out IL2CPU which translates IL to machine code. Maybe it can be used on .NET assemblies.
Upvotes: 6