I’ve been wondering about this for a while and haven’t really found a great answer for it. From what I understand, WASM is:
-
Faster than JavaScript
-
Has a smaller file size
-
Can be compiled to from pretty much any programming language
-
Can be used outside of the browser easier thanks to WASI
So why aren’t most websites starting to try replacing (most) JS with WASM now that it’s supported by every major browser? The most compelling argument I heard is that WASM can’t manipulate the DOM and a lot of people don’t want to deal with gluing JS code to it, but aside from that, is there something I’m missing?
IIRC a startup tried to exactly that… It’s wasn’t any faster and is actually harder to develop.
EDIT:
Sorry ignore these videos. I don’t remember which YouTube video it is. But more importantly Rust + WASM got really better than JS these days.
https://www.youtube.com/watch?v=461735zrjzY
https://github.com/leptos-rs/leptos
Here is an alternative Piped link(s): https://piped.video/watch?v=461735zrjzY
Piped is a privacy-respecting open-source alternative frontend to YouTube.
I’m open-source, check me out at GitHub.