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

Figma has been using wasm in production since 2017.

Wasm in the browser has its niches, but JS remains the best choice when considering load time and transfer size. JS is not the pinnacle of dev experience, but any other language has megabytes of runtime or libraries which need to be fetched and loaded before your application code. All browsers have JS batteries included, for better and for worse.




> but any other language has megabytes of runtime or libraries which need to be fetched and loaded before your application code.

It's really not that bad for languages that allow an embedded-programming style (C, Rust, C++, Zig, ...). For instance this C64 emulator written in C has a 97.5 KBytes compressed WASM blob (and this includes 20 KBytes of dense ROM data which is barely reduced in size when compressed), plus 14 KBytes for the JS shim:

https://floooh.github.io/tiny8bit/c64.html

By comparison, the minified and compressed main.js file of JS Beeb (which I assume contains the bulk of the emulation code) is 119 KBytes download size:

https://bbc.xania.org/


> JS remains the best choice when considering load time and transfer size.

Wasm often has a larger transfer size (although wasmgc might go a long way toward alleviating this). But it also often has a smaller load time. Web browsers can load equivalently sized wasm bundles much faster than they can load JavaScript.


Where can I learn more about this?


Additionally if computation performance is a bottleneck, just write some shader code, much easier than dealing with WebAssembly toolchains.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: