upvote
> I'm sure there are people who want a C# without GC

There's also C++ and although it is a monstrosity the practical thing would be to use that.

If you want a serious alternative to C++ I don't see it in C# without GC. On the other hand I have seen a lot of C++ code where normal C# would be much better suited.

reply
Also people expect when they use a C# compiler that existing programs and libraries written in C# will be usable, but this doesn’t appear to support the same standard library APIs. So why use C# at all instead of a language with an ecosystem that has the properties you want?
reply
I mean, unless you don’t need any memory to be released during a run, everything needs to be rewritten to use memory management through arenas, which is a whole new memory management paradigm even for most people used to languages which require either manual memory management or highly specific lifetime specifications. So, yeah, no nontrivial existing code is usable even before you consider that none of the libraries supplied by the runtime that most code relies on are available.
reply
Such as?
reply
.NET runtime also has generational GC and escape analysis (so objects can be allocated on the stack if they have a known lifetime). Generational GC essentially give you a super fast bump allocator for short lived objects: faster than malloc.

Even without unsafe we can allocate objects once and just reuse them. But why would you? C# is the go to for interfacing with native code and unmanaged memory. ( C# is way ahead of Java tho JDK 25 is beginning to catch up). I miss C#.

Figure out what parts of your app needs to be “downcoded” and optimize that. Enjoy bump allocators and plentiful libraries for the rest of it.

I wrote graphics applications in C# that used 3GB of memory back when we had to tell XP, at boot, to not use half the 32bit address space for itself. Most of it was in unmanaged space. C# is awesome.

reply
NativeAOT can't compile for DOS.
reply
Which would be a problem if I needed to write code today and send it back to the 1990s to be run, but I have about as much need to compile to DOS as I need to produce punch cards to load into ENIAC.
reply
I... guess so? But the last time I had users who use DOS was in my previous life. NativeAOT supports iOS though, which is a reasonable target for the current-life me.
reply
NativeAOT gets rid of JIT not GC. The language is rich enough that you can avoid making garbage though.
reply