30 points sumnole 5 hours ago 7 comments

andsoitis 5 hours ago | parent

this looks phenomenal. Can't wait to try it out.

weinzierl 46 minutes ago | parent

This is s bit of an unfair comparison, isn't it?

Since WASM ships with a garbage collector that C# can use while Rust does all the memory management itself, of course it will be bigger.

EDIT: Reading OP more thoroughly I think I'm wrong. Apparently in the compared versions, the C# version ships a runtime with garbage collector.

afdbcreid 42 minutes ago | parent

C# doesn't (and can't) use WASM GC.

The comparison is unfair for other reasons (the C# runtime was optimized for WASM size and the Rust not, it's possible to be much smaller in Rust), but it's still cool.

xnorswap 31 minutes ago | parent

Any cross-language benchmarks are always unfair for those kinds of reasons, because ultimately everything is eventually possible against any given hardware.

What matters more for comparing what you get out of languages is the output of idiomatic code written against typical frameworks.

Indeed, it's still cool to see, even if it's optimised to beyond recognition, as seeing the occasional C# win is nice to keep the "re-write in rust" wolves from the door, who seem to ever lurk, especially in a world where re-writes appear easier.

afdbcreid 19 minutes ago | parent

> ultimately everything is eventually possible against any given hardware.

Not everything, no. You can't run C# without the .NET runtime. Some parts of it are irreplaceable.

And the Rust optimizations to shrink binary size (see https://github.com/johnthagen/min-sized-rust) are commonly done in production when it matters, not just in WASM but also in embedded.

sondr3 29 minutes ago | parent

It's a bit of an unfair comparison, the benchmarked C# code here is also post-processed which none of the other targets are. See this comment[1] on reddit where the author announced this on the /r/dotnet subreddit, Rust can go much, much lower. The title is misleading at best and a lie at worst, this is great but saying it beats Rust is a far cry from the truth except for the very narrow benchmark made to showcase this tool.

[1]: https://www.reddit.com/r/dotnet/comments/1x7wsgb/rust_just_l...

xxs 18 minutes ago | parent

personally, I disregard and ignore cross-language benchmarks. Benchmarks are hard, benchmarks in managed languages are extra hard.

And then the personal writing the code has to be an expert in all languages involved to make it even half fair, instead of just a sound-bite/click-bait.