11 comments

  • sondr32 hours ago
    It&#x27;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 &#x2F;r&#x2F;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.<p>[1]: <a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;dotnet&#x2F;comments&#x2F;1x7wsgb&#x2F;rust_just_lost_the_classic_hello_world_wasm_size&#x2F;ph93azh&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;dotnet&#x2F;comments&#x2F;1x7wsgb&#x2F;rust_just_l...</a>
    • torginus7 minutes ago
      This is an entirely different toolchain from the official .NET one, which is kind of the point of the post, which is experimental, but intended to for production, not for beating benchmarks.<p>Rust also builds a pretty small binary, which is cool. This isn&#x27;t really meant to be a &#x27;C# is better than Rust&#x27; post, but more pointing out that Blazor (which is the official MS implementation) builds huge binaries; often &gt;10MB, which is a real problem. This fixes that.
    • xxs2 hours ago
      personally, I disregard and ignore cross-language benchmarks. Benchmarks are hard, benchmarks in managed languages are extra hard.<p>And then the person writing the code has to be an expert in all languages involved to make it even half fair, instead of just a sound-bite&#x2F;click-bait.
  • TazeTSchnitzel11 minutes ago
    &gt; The 46.7 KiB program is the baseline, not the boundary.<p>what does this even <i>mean</i>
    • dionian5 minutes ago
      I speak claude, it means 46.7 is the minimum and it could go further.
  • CharlieDigital22 minutes ago
    There&#x27;s something about C# that just feels so right for me for backends (as long as you stick to the more modern conventions).<p>Good tooling, modern language features (C# 15 has the long awaited unions, closed hierarchies), great debugging experience, etc.
  • Scaled23 minutes ago
    Worth pointing out this is not open source, if that is an important consideration when you&#x27;re comparing the two (it is to me).
  • WhereIsTheTruth3 minutes ago
    Of course, they lobbied to transfer the bloat onto the WASM runtime itself
  • dev_l1x_be23 minutes ago
    X is better than Y where Y is irrelevant and the difference is marginal is a low relevance observation.
  • weinzierl3 hours ago
    This is s bit of an unfair comparison, isn&#x27;t it?<p>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.<p>EDIT: Reading OP more thoroughly I think I&#x27;m wrong. Apparently in the compared versions, the C# version ships a runtime with garbage collector.
    • afdbcreid3 hours ago
      C# doesn&#x27;t (and can&#x27;t) use WASM GC.<p>The comparison is unfair for other reasons (the C# runtime was optimized for WASM size and the Rust not, it&#x27;s possible to be much smaller in Rust), but it&#x27;s still cool.
      • xnorswap2 hours ago
        Any cross-language benchmarks are always unfair for those kinds of reasons, because ultimately everything is eventually possible against any given hardware.<p>What matters more for comparing what you get out of languages is the output of idiomatic code written against typical frameworks.<p>Indeed, it&#x27;s still cool to see, even if it&#x27;s optimised to beyond recognition, as seeing the occasional C# win is nice to keep the &quot;re-write in rust&quot; wolves from the door, who seem to ever lurk, especially in a world where re-writes appear easier.
        • afdbcreid2 hours ago
          &gt; ultimately everything is eventually possible against any given hardware.<p>Not everything, no. You can&#x27;t run C# without the .NET runtime. Some parts of it are irreplaceable.<p>And the Rust optimizations to shrink binary size (see <a href="https:&#x2F;&#x2F;github.com&#x2F;johnthagen&#x2F;min-sized-rust" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;johnthagen&#x2F;min-sized-rust</a>) are commonly done in production when it matters, not just in WASM but also in embedded.
          • memsom1 hour ago
            &gt; Not everything, no. You can&#x27;t run C# without the .NET runtime<p>You can compile C# to an AOT exe, and when you do that it will literally only be what it needs to work, less and dynamic libs.
          • jeswin1 hour ago
            &gt; You can&#x27;t run C# without the .NET runtime<p>With NativeAOT, same a golang then. NativeAOT has worked wonderfully for us, and in some specific situations faster than Rust.
      • fweimer53 minutes ago
        Is the support gap mostly related to weak references and finalizers? Or is something else missing?<p>(Obviously those are already pretty significant gaps.)
  • jedisct11 hour ago
    Not very hard... Rust wasm binaries are ginormous.<p>If you care about WASM performance, size and memory usage, Zig is a much better candidate.
  • andsoitis7 hours ago
    this looks phenomenal. Can&#x27;t wait to try it out.
  • sagacity2 hours ago
    [dead]
  • bob10292 hours ago
    I never understood the appeal of wasm outside special performance cases. We never once considered moving from Blazor server side to the wasm mode. Not one time in 5+ years did it ever come up. The whole idea turned out to be a huge distracting waste of engineering talent. Instead of chasing this idealistic wasm pipeline and struggling with weird websocket transports, we could have been writing boring old cshtml and JavaScript on top of stateless HTTP.<p>Unless you are building a web version of autocad or premiere, I don&#x27;t see the point of engaging with this technology.
    • pjc501 hour ago
      &gt; Unless you are building a web version of autocad or premiere,<p>Yes, but that&#x27;s the use case. I don&#x27;t think you&#x27;ll be able to find someone respected saying &quot;yes we should use this for all use cases regardless of what you&#x27;re doing&quot;. At the other end, htmx is completely fine.
    • bluegatty1 hour ago
      It&#x27;s for in-browser, security and portability, generally not worth it performance.<p>A lot of edge cases they&#x27;d rather run WASM then a JS or Python VM, it has nicer containerization characteristics. But even with those key cases - it&#x27;s not necessarily a core, critical technology.<p>WASM is &#x27;always on the horizon&#x27; as being important.<p>If we had in 2015 what we had today, there might have been a bit of a breakthrough.
    • ChrisRR1 hour ago
      Because the abundance of javascript has made the web a bloated mess