Hacker News new | past | comments | ask | show | jobs | submit login

> In terms of languages for the web with WASM I think it has massive advantages over Rust.

Can you please elaborate what are those?




Not the OP, but I have the same opinion (I think):

Zig being better than Rust for targeting WASM is similar to C being better than C++ for that use case. High-level abstractions usually work against a minimal binary size, and WASM is a platform where the size of the 'executable' is very important.

Both C and Zig typically generate smaller binaries 'by default' by avoiding and discouraging high-level abstractions which are so fashionable now both in 'modern C++' and Rust.

Of course it is possible to create really small-sized binaries both in C++ and Rust if you're really careful and use an "embedded programming mindset", but this is not how those languages are taught, it's not the 'default' and you'll loose most of the high-level features that differentiate C++ and Rust from C or Zig anyway.

I wrote a blog post about that topic a while ago: https://floooh.github.io/2018/05/01/cpp-to-c-size-reduction....

This was when I just switched from using C++ to C as my 'default language', so that whole idea was quite new to me at the time, and that surprise is reflected in the blog post. In the meantime I have a better idea why higher level languages tend to cause bloated software, despite promising "zero cost abstractions".




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: