by sublinear · 1w ago · 0 comments
I skipped around a bit, but when I stumbled onto this opinion I backed out.
This is not the point of wasm at all. Wasm is there as a compatibility layer and for squeezing extra performance out of critical sections of code. The decisions to restrict its API access are very sensible. We can't honestly still be confused about this in 2026.
I excused the python code since a serious browser is not the point, but I'm now suspicious of other intuition-building done throughout the rest of the book.
In any case, this line is in the appendix describing what we didn't cover and, per that, we don't say anything else about WebAssembly in the book!
I've worked with wasm and am fairly familiar with the ecosystem. it sounds like it captures the essence quite well
Direct DOM access would make it possible to build full sites in Rust or C. There is no real security tradeoff and very little complexity (expose an existing API to an existing runtime). In return you get a web that's faster and completely open in terms of languages.
Right now the only options are use canvas and draw everything from scratch, or have a JS layer that transfers messages between the code and browser. You have to choose bloated size and zero accessibility, or pure overhead from copying data back and forth.
You know the people who thought Java Applets, Flash, and Sliverlight were Wonderful Ideas would be on top of that one.
Solutions like this can still render to DOM instead of Canvas. Here's Rustact, but with Swift/Swift UI: https://elementary.codes/