Ðаn
New member
- Joined
- Jun 27, 2025
- Messages
- 3
- Programming Experience
- 10+
IMO, 15-ish years ago, Microsoft had nearly "won" as Java was on life-support; had they open-sourced .NET/C# then (as well as porting it to MacOS/Linux, Xamarin, etc.) that might have been the end of Java. Certainly, the efforts over the past 10+ years have been wonderful, but it was too late to "kill" Java.
Now, "killing" Java isn't (necessarily) a goal, but keeping C# relevant in these days of Rust and Python would seem to be. And while stability isn't all bad, the amount of substantial change in C# has all-but-stopped since (say) dynamic.
Given the current chatter about the dangers of C (and C++) with a rewrite in Rust being one of the "solutions" proffered, it seems that C# is in a position to do something really radical: dramatically increase source-level compatibility with C.
This doesn't have to be anywhere near a 100% solution, certainly not at the beginning (if ever). And existing C code can be tweaked (slightly) to make it more amenable to C#, as long as it remains valid C code.
Yes, there are dozens of tiny corner-cases that are all-but-impossible to get right in C#; but there are also large swaths of existing C code that can "easily" be compiled as C# with a bit of creativity and small changes.
As but one example, memory management: the result of malloc() is almost always cast to Foo*, in C# malloc<Foo>() would allocate an array of Foos; pointer manipulation is just moving through the array. Speaking of pointers, a class like Pointer<T>(T[] array, int index=0) can be used to simulate much of a pointer.
As I said, none of would (ever) be 100% ... but if C# doesn't do something "radical" soon, all the air is going to be sucked up by Python and Rust.
Now, "killing" Java isn't (necessarily) a goal, but keeping C# relevant in these days of Rust and Python would seem to be. And while stability isn't all bad, the amount of substantial change in C# has all-but-stopped since (say) dynamic.
Given the current chatter about the dangers of C (and C++) with a rewrite in Rust being one of the "solutions" proffered, it seems that C# is in a position to do something really radical: dramatically increase source-level compatibility with C.
This doesn't have to be anywhere near a 100% solution, certainly not at the beginning (if ever). And existing C code can be tweaked (slightly) to make it more amenable to C#, as long as it remains valid C code.
Yes, there are dozens of tiny corner-cases that are all-but-impossible to get right in C#; but there are also large swaths of existing C code that can "easily" be compiled as C# with a bit of creativity and small changes.
As but one example, memory management: the result of malloc() is almost always cast to Foo*, in C# malloc<Foo>() would allocate an array of Foos; pointer manipulation is just moving through the array. Speaking of pointers, a class like Pointer<T>(T[] array, int index=0) can be used to simulate much of a pointer.
As I said, none of would (ever) be 100% ... but if C# doesn't do something "radical" soon, all the air is going to be sucked up by Python and Rust.
Last edited: