News for hackers. Stuff that matters.
Re:.NET 6 is now in Ubuntu 22.04 by sedatk on Tuesday August 16, 2022 @02:18PM (#32486647)
I think C#/.NET has more performance-oriented affordances than Java:

- It supports structs, and unboxable structs called "ref structs". They let you to avoid GC/heap-alloc for small data structures with clear ownership semantics.

- It uses type reification for generics instead of type erasure. Combined with value-types, this can produce very optimized code. The downside is larger binary sizes.

- It allows unsafe programming with pointer arithmetic where performance is truly critical. This is where C# is closer to C/C++ than Java.

- Supports native compilation to a target architecture. This lets you avoid JIT overhead and lets you ship self-contained binaries (like Go).

- .NET supports source generators which can let you keep maintainable code and generate an optimized one.

Performance aside, C# is a very pleasant language to use, and .NET is a delightful runtime. I'd say give it a try and see it for yourself.

There are no comments on this comment yet.