News for hackers. Stuff that matters.
Re:The search for easier safe systems programming by neonsunset on Wednesday May 08, 2024 @07:00AM (#40296574)
.NET of today seems to stand out quite a bit in comparison to many other MSFT-backed projects. Especially if you look not at non-essential and possibly azure-related tooling but rather at the "core" itself (that is, SDK, runtime and compilers) which is distributed under permissive MIT license which you can just take and do anything with.

To surprise of many outside of .NET community, it has much better performance than Swift[0][1][2] and lets you match performance of C and C++ in areas that matter.

[0] https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

[1] https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

[2] https://benchmarksgame-team.pages.debian.net/benchmarksgame/... (better performance for short-running benchmarks sensitive to JIT)

(no direct comparison but Tl;Dr: ARC and Swift defaulting to virtual dispatch that can't always be elided with WMO results in Swift having much lower (even if more consistent) performance)

Re:The search for easier safe systems programming by pjc50 on Wednesday May 08, 2024 @08:18AM (#40297163)
With AOT and "[UnmanagedCallersOnly]" you can even emit C# libraries that are callable from true native code using the C FFI.
Re:The search for easier safe systems programming by neonsunset on Wednesday May 08, 2024 @08:21AM (#40297186)
Yup, you can even statically link them into C/C++/Rust/etc. (or vice versa)!
Re:The search for easier safe systems programming by igouy on Wednesday May 08, 2024 @01:39PM (#40300872)
Re:The search for easier safe systems programming by neonsunset on Wednesday May 08, 2024 @04:52PM (#40302608)
Thanks!

Also wow, I stand corrected, Swift is a much stronger contender in Benchmarks Game scenarios than earlier microbenchmarks and research projects that I've seen would suggest. Particularly when using its own SIMD abstraction, it is likely LLVM makes very competent transformations, possibly merging narrower operations into a wider ones, replacing one set of intrinsics with another, etc.

However, still seems to suffer quite a bit, just like Go, in Binary Trees (it's not like C# does the best there either, the winners use bump allocators, and then there's also a 2.6s magic entry by Java, write barrier elision?).