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.
- Is there such a thing?
- If there isn’t, is such a thing even possible, or am I misunderstanding something fundamental about C#?
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.