3 ms·
we still need js shim for dom access :(
by tpm 4mo ago
we still need js shim for dom access :(
- afiori 4mo agoAsking for 0% js 100% wasm website is like wanting a C-free linux distro
- tpm 4mo agoOne could write a js-less DOM impl I think.. neither Chrome nor Firefox itself is written in js unlike big parts of Linux that are indeed written in C. Explorer shipped with vbscript as a language that can manipulate the DOM. The really big issue in this case is network effect, which is why I hope something can come out from the momentum building behind WASM.
- dfabulich 4mo agoOne couldn't, because you'd need to standardize a JS-less DOM, which requires one to persuade Apple, Google, Microsoft, and Mozilla to agree on a new standard for a JS-less DOM API. The DOM API is currently defined as a JS API, including JS strings, JS objects + properties, JS Exceptions, JS Promises, JS garbage collection, and on and on and on. The effort to get all the browsers to agree to standardize a new JS-less DOM API would take years; none of the browser vendors even want to begin that conversation today.
- GoblinSlayer 4mo agoWeb API is described in WebIDL, and javascript has its own approach to consume these interfaces.
- afiori 4mo agoThe issue is that many modern DOM APIs assume js semantics and types (eg promises, iterables, etc) so you need to "reimplement" some js semanthic in wasm; sorta like how apple added a few custom instructions on the M1 chip specifically for the type of floating point operation required by js.
- breve 4mo agoThey're doing it already: https://hacks.mozilla.org/2026/02/making-webassembly-a-first-class-language-on-the-web/ https://hacks.mozilla.org/2026/02/making-webassembly-a-first...