Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For any comparison to C# (it being slower or having GC pauses), it probably doesn't take into account the latest advances (.NET 6). That's understandable given there isn't really incentive to gain a mastery in every language during a comparison.

With regards to C#/.NET 6, it is now easy to:

- Have zero-allocation code through the whole stack, making garbage collection zero/near-zero. [Span<T>, Memory<T>]

- Distribute platform specific all-in-one binaries with no unbundling/uncompression or need to install any runtime. [dotnet publish -r win-x64 -c Release -p:PublishSingleFile=true -p:PublishTrimmed=true]

- For hot-path optimisation (many available profiling tools), dive into new high-performance APIs such as CPU vector intrinsics, or native memory allocation (aligned or unaligned). [System.Runtime.Intrinsics.X86, System.Runtime.InteropServices.NativeMemory]

- For faster startup times: AOT compilation. (Not necessarily faster at runtime in general; JIT has advantages there with being able to detect hot paths)

These are just the features I've used, there are doubtless many more. In the future .NET 7, it will be possible to disable runtime marshalling so interop calls to C DLLs have no overhead (along with a compile-time analyzer to throw errors if the types you're using are not compatible, aka 'blittable').

Credit to Vale - it appears to be addressing all these things so there's certainly an interesting future ahead.



I think many of these complaints tend to be focused on the aging Mono runtime experience used by Unity pre-DOTS, or classical pre-.NET Framework 4.5.


Agreed, that would be a worthwhile caveat for authors to add.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: