5 ms·
I'm not a programmer, so Wasm is DOM-based or Canvas-based? I mean does it support explicit DOMs?
by ReD_CoDE 7y ago
I'm not a programmer, so Wasm is DOM-based or Canvas-based?
I mean does it support explicit DOMs?
- yoklov 7y agoNeither 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.
- snek 7y agoWasm 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.
- scrungus 7y agoI 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/ https://timhutton.github.io/sdl-canvas-wasm/ [2] https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/ https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webas...
- ReD_CoDE 7y agoThanks all