A comparison of Rust’s borrow checker to the one in C#

Perception and Adoption of C#

  • Several comments argue C#’s power is underappreciated in “startup/HCN culture,” partly due to historic Windows lock‑in, “enterprise” stigma, and ecosystem churn (.NET Framework/Core/.NET).
  • Others note regional differences: in some places .NET is seen as mid‑tier or legacy, with enterprises preferring JVM or JS/TS; Go is cited as the only “new” language with significant adoption in some markets.
  • Some see C# as a pragmatic, “jack of all trades” language comparable to or nicer than Java, but still overshadowed by Java’s larger ecosystem.

Borrow Checking, Lifetimes, and Rust Comparison

  • The article’s claim that C# achieves Rust‑like safety without heavy type theory resonates with many, but several point out C#’s model is weaker:
    • C# can fall back to GC and escape hatches, Rust cannot.
    • Rust’s aliasing and ownership model also enables predictable multithreading guarantees, not just lifetime safety.
  • C#’s ref/Span/lifetime analysis is seen as adding a “second, low‑GC dialect” inside the language, mainly aimed at high‑performance library authors rather than typical line‑of‑business code.

Performance, GC, and Low‑Level Features

  • Many stress how far modern .NET has come: ref structs, Span, SIMD, NativeAOT, stack allocation, custom allocators, and even pluggable GCs make near no‑GC code possible, though often with custom collections and patterns.
  • Unity is widely criticized for using an outdated Mono/GC stack; several argue this unfairly taints perceptions of C# for games. Others counter that GC hitches are a real problem in some shipped titles.
  • A recurring theme: C# gives strong tools for performance, but you must know and consciously avoid allocation‑heavy idioms.

Benchmarks and Aliasing

  • TechEmpower web benchmarks and Benchmarks Game are debated:
    • Some view them as “cheaty” and unrepresentative of real apps due to extreme micro‑optimizations and C library calls.
    • Others say they still show .NET is highly competitive and that aliasing guarantees (Rust, C restrict) give modest but real speedups (often quoted as 0–5%).

Tooling, Portability, and GUI Story

  • Cross‑platform server‑side C# with .NET Core/ASP.NET is described as solid on Linux/macOS/Windows; Rider and VS Code are popular non‑Windows tools.
  • GUI story is seen as weaker: MAUI is slow to mature and mobile‑centric; third‑party frameworks (Avalonia, Uno, Photino, Eto, PanGUI) are promising but fragmented.
  • Backwards compatibility in C#/.NET is defended as essential for enterprise trust, though some wish for a “clean break” mode to simplify language evolution.

Language Design, Ecosystem, and Alternatives

  • C# is praised for balanced OO/functional features, strong tooling, and coherent “one obvious way” libraries; some call it “mostly perfect” aside from missing discriminated unions (workarounds via source generators exist).
  • There’s recurring comparison to F#, Kotlin, Rust, Go, and older languages (Modula‑3, Ada/SPARK), with the view that many “new” ideas are rediscoveries of older research.