Re:Wasm vs. PNaCl Performance Benchmark
by ReD_CoDE on Sunday August 25, 2019 @07:20PM
(#20796293)
I'm not a programmer, so Wasm is DOM-based or Canvas-based?
I mean does it support explicit DOMs?
[ Parent
| on HN ]
Neither really. It doesn’t have direct access to a canvas API or to the DOM, but you can proxy calls through javascript. There’s a plan to allow avoiding this overhead, but it’s fairly early.
Wasm has no concept of a browser, or any outside-world interaction APIs. Wasm hosts can provide APIs, for example emscripten provides bindings to wasm for canvas and networking.
I think it depends on how you compile it i think. for example,you can use SDL or something with an emscripten compiler flag [1]. but i am not super sure how that works without canvas, i haven't tried it with normal sdl
web assembly is not necessarily just for the browser though. you can have webassembly without any web[2], just to run binaries across different platforms. i think it's pretty cool
[1] https://timhutton.github.io/sdl-canvas-wasm/
[2] https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webas...