Top
Best
New

Posted by reverseblade2 5 hours ago

Show HN: Zero C# – C# without a runtime or GC(onurgumus.github.io)
88 points | 63 commentspage 2
Pannoniae 3 hours ago|
This thread feels like a bit of the old Dropbox thread ;)

"what is this useful for" - You want to write native code without a runtime or GC but you also don't want to deal with C++ with its arcane rules, edge cases, an awful dependency management story and complexity in general.

Rust is a good candidate for this as well, although it has quite a learning curve.

"you can already do this in standard C#" - Yes but the ecosystem assumes GC so you need to write everything yourself. There are some low allocation APIs but definitely not for everything. The concept of "C# but even lower level" is something which has a place, IMO. Just like how you can technically add assembly to C#, either by linking it with nativeAOT or emitting at runtime but it's not built-in support for inline assembly, you know.

vips7L 4 hours ago||
Reminds me of Beef: http://www.beeflang.org/
OnceMoreUntoThe 4 hours ago||
Yeah, this is just a bunch of AI slop, but, ehhm... I really don't get all the CLR GC hate? Sure, if you're running a 24-months-ago Mono build, and your game performs like crap, I can sort-of sympathize, but otherwise?

Look, I'm all-in on CLR/C#, and one of my 'apps' is a 24/7 industrial camera monitoring system, and it has been running for the past, like, 3 months, on .NET 10 with "GCSettings.LatencyMode = GCLatencyMode.SustainedLowLatency" and "stackalloc" where needed, and...

Its performance, handling 8x ~800Mb/s streams has been... absolutely okay: 0 bytes over-allocated in the past 90 days (which is the last time my CoreOS-deployment auto-rebooted: all nodes are behind a VPN and outbound-only, so the latest OMG-CRITICAL-CVE doesn't really apply), so...

"If it works, it works"

hirvi74 3 hours ago|
> * if you're running a 24-months-ago Mono build, and your game performs like crap*

It's always the fault of the arrow and never the archer.

OnceMoreUntoThe 3 hours ago||
I've no idea what that's supposed to mean.
Dwedit 3 hours ago||
That's just another way to say "A bad workman blames his tools"
amelius 4 hours ago||
The "without any GC" part has me worrying. Is this advocating to just accumulate your garbage and throw it out only once every blue moon?

Also, does it ship with GUI libraries?

DougN7 4 hours ago|
“Memory comes from arenas you free all at once”
amelius 4 hours ago||
Yes, but this means you can only do it at very specific points in your program. E.g. after serving a request. This doesn't work for every type of program.
yodon 2 hours ago||
You can do this today in vanilla C#. Pause garbage collection, then resume it. Done. Even Unity's ancient Mono variants could do this almost a decade ago.
amelius 2 hours ago||
I don't see how that solves the problem. The GC in the article is substantially simpler than the GC in "vanilla C#" ...
kvuj 4 hours ago||
Doesn't C# already support AOT compilation?
dosshell 4 hours ago||
I like arena allocators, but some how i fel like reference counting would have been a better match for C# philosophy, like swift.
andyfilms1 4 hours ago||
Finally, C--
lpedrosa 4 hours ago|
Don't you mean C♭?
jayd16 4 hours ago||
Does this need a fork? Just pause the GC and use these patterns?
DeathArrow 3 hours ago||
If you take GC out of C# and add arenas, why not use C or Zig already? If it's about the syntax, C's syntax is already similar.
tester756 2 hours ago|
> If it's about the syntax, C's syntax is already similar.

lol

what about all the sane language features and stdlib?

pipeline_peak 3 hours ago|
I’ve always wondered what C# would be like without GC. Yet without Reflection, there really isn’t anything meaningful here. It’s just nice syntax leftover.
More comments...