2 ms·
Eventually by using the component model which will expose the DOM API. It will get to direct wasm to WebIDL calls one day: https://github.com/WebAssembly/compo
by peutetre 2y ago
Eventually by using the component model which will expose the DOM API. It will get to direct wasm to WebIDL calls one day:
https://github.com/WebAssembly/component-model https://github.com/WebAssembly/component-model
The component model is being used for the WebAssembly System Interface (WASI). WASI provides operating system integration for wasm applications outside the browser:
https://github.com/WebAssembly/WASI/tree/main https://github.com/WebAssembly/WASI/tree/main
In the meantime you can use JavaScript glue code auto-generated by your toolchain to access the DOM. This will be made better with builtins like the js-string-builtins proposal:
https://github.com/WebAssembly/js-string-builtins/blob/main/proposals/js-string-builtins/Overview.md https://github.com/WebAssembly/js-string-builtins/blob/main/...
You can call JavaScript functions and DOM methods from wasm like this example from Hoot, which is a Scheme to wasm compiler:
https://spritely.institute/news/building-interactive-web-pages-with-guile-hoot.html https://spritely.institute/news/building-interactive-web-pag...