3 ms·
I've been wondering about that lately. What is the rationale for making it necessary to run WASM binaries through JavaScript? Seems like a missed opportunity to
by VyseofArcadia 3y ago
I've been wondering about that lately. What is the rationale for making it necessary to run WASM binaries through JavaScript? Seems like a missed opportunity to not be able to just point a script element at a WASM blob, but I'm sure I'm overlooking something.
- dunham 3y agoWhen I last looked, it seemed like WASM blobs just take arrays of numbers and return arrays of numbers. No objects, strings, or DOM elements, so I think it'd be tough to do web dev in wasm as it stands. And you need javascript glue if you want anything in the way of side effects. There is, however, quite a bit you can do in it. TeX has been compiled to wasm[1], it's about 600kb uncompressed 90k compressed (the memory image with latex loaded is about 6MB compressed though - latex is a beast). I think anything computationally intensive would be a good candidate for wasm (it has int64). 1: https://github.com/kisonecat/web2js https://github.com/kisonecat/web2js
- VyseofArcadia 3y agoRight, yes, that's how WASM is now, but what I'm asking is why didn't we give WASM access to the DOM? We could have, and we just didn't.
- dunham 3y agoSounds good to me, I was disappointed when I learned that wasm didn’t do this already. (It’d be nice to have tail call optimization too.)
- marcosdumay 3y agoIt is one of the many things being worked on. The truth is that no part of the web standard bodies has WASM as a priority, so it moves slowly. Anyway, on practice all that means is a bit of lost performance on the DOM interaction. It's a big deal if you do a react-like framework, but the DOM has bad performance anyway, so people tend to not create react-like frameworks.
- wolpoli 3y agoGoogle already tried the blob with Native Client, but I recall Firefox decided not to support it.