Need help?
<- Back

Comments (100)

  • raincole
    C# already provides many tools for your performance-critical code though. You can use pointers in unsafe. You can allocate unmanaged memory with Marshal. You can avoid copy with Span. You can even manually vectorise with Vector.IsHardwareAccelerated and such.You can also distribute apps without .NET runtime with NativeAOT.I'm sure there are people who want a C# without GC, but for me it's just... sufficient enough.
  • bob1029
    The GC is a feature. Not a bug to be eliminated.GC is not surrendering control. That seems to be HN's #1 bug bear. The sensation that someone or something is taking control away from you. The proper way to frame this is that you can actually focus on the original problem you set out to solve. Risking memory leaks is crazy when it's not something the customer is demanding. Even in gaming I think the GC is fine. There are ways to spread the impact across frames and bound the amount of time spent collecting.If your clever scheme wouldn't work with a GC-managed heap, it probably won't work with one managed by hand either.
  • YuechenLi
    So... What does this have over using NativeAOT which already exists?Keep in mind a large portion of time NativeAOT is actually SLOWER than going through RyuJIT with the only definitive benefit being smaller binaries, and it's not like you can't do Span<T> and ref structs in modern C# for manual low level memory control already.So my question is just... why?
  • andix
    Assuming this is very similar to bflat: it's a cool idea and fun to play with, but not very useful. C# is not designed to run without a GC, existing code usually won't run, because the standard library is missing.Just using C, Rust, Zig, or whatever is probably nearly always the better option. Those languages are designed to work without GC and provide various well established ways to manage memory.
  • hollowonepl
    I’m not sure, the whole point of this language, standard libraries and runtime is built around GC. Nobody from C# world is educated or prepared to manually manage memory. This is just bare metal C++ with a lot of it stripped away and just nicer/cleaner syntax that does not inherit so much from C and POSIX archeology.Nice POC, especially on MS-DOS but nothing truly relevant in the long run, I’m afraid
  • buybackoff
    For C# as is, what I really would appreciate is a frozen GC mode. Not zero GC, similar to Epsilon GC in Java. After initial state loading and forced GC, I would like to be able to apply a SustainedNoGC mode, that just does not even try to collect, no scanning, no pauses at all, it can only allocate. And notifications (an event) after some X bytes allocated, or just a reliable way to monitor the allocated size. The existing modes such as SustainedLowLatency or NoGCRegion are good but not enough. For some low latency workloads it's OK to allocate many GBs and then pause explicitly.Random forced pauses are the only problem that comes from GC, otherwise it's great for throughput and just a nice feature, as a sibling comment says. No GC languages do not make code magically faster, they still have malloc/free. However, GC is surrendering control over when a program may be paused.
  • Dwedit
    You really don't want to use C# with the "Bflat/Zero" runtime library. Even something very basic like strings is unsupported. It becomes C code with funny syntax that doesn't align well with the language.I have not yet tested out Beef, but it seems to be more in line with what you'd want from a native C#-like language.
  • real_faxenoff
    I'm developing a small .NET utility called montab (https://github.com/faxenoff/montab - taskbar with permanent previews for Windows) and have been trying to minimize its size and CPU/GPU usage as much as possible. The result is a 0.88 Mb binary with near-zero system load.It would seem that Zero C# is the ideal solution for me. But here’s what I’ve actually found out: I’d have to rewrite absolutely everything, and the lack of a garbage collector when constantly working with a bunch of WinAPI calls is a problem with no solution.I’ve come to realize that this might only be suitable for new applications that don’t use external components.
  • vips7L
    Reminds me of Beef: http://www.beeflang.org/
  • StilesCrisis
    Why did they eliminate reflection? That doesn't need huge runtime support or garbage collection.
  • SuperV1234
    Cool project, I don't understand all the hate. This is great for gamedev and similar domains where latency matters
  • Pannoniae
    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.
  • exceptione
    It builds on top of bflat, so there is a real non-vibed base there. Nice to see people take those type of bare metal efforts even further.
  • amelius
    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?
  • OnceMoreUntoThe
    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"
  • kvuj
    Doesn't C# already support AOT compilation?
  • dosshell
    I like arena allocators, but some how i fel like reference counting would have been a better match for C# philosophy, like swift.
  • andyfilms1
    Finally, C--
  • bilekas
    I'm not seeing why exactly..
  • jayd16
    Does this need a fork? Just pause the GC and use these patterns?
  • DeathArrow
    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.
  • pipeline_peak
    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.
  • luxuryballs
    vote for calling it C# Zero or hmm Z#?
  • CAP_NET_ADMIN
    In the age of LLMs and agentic coding - does the syntax even matter? Do you even look at the code anymore?Just use Rust.
  • FuroxArt
    [flagged]
  • reverseblade2
    [dead]
  • anon
    undefined