3 ms·
Does WASM have the ability to interact directly with the DOM now or is that still in development?
by cercatrova 5y ago
Does WASM have the ability to interact directly with the DOM now or is that still in development?
- Deukhoofd 5y agoAs I understand it, WASM needs to have some kind of way to universally describe high-level types before it's able to have DOM support. There's currently a proposal for that, but it's not yet in the core spec. https://github.com/WebAssembly/interface-types/blob/main/proposals/interface-types/Explainer.md https://github.com/WebAssembly/interface-types/blob/main/pro...
- jeffparsons 5y agoThe Interface Types and Module Linking proposals were recently superseded by the Component Model proposal, which unifies the two: https://github.com/WebAssembly/component-model https://github.com/WebAssembly/component-model
- Deukhoofd 5y agoBrilliant, thanks for the link!
- datavirtue 5y agoGenuinely curious: why would you want to access the DOM with wasm? Can't we finally let html be for documents and wasm be for applications? The pain of shoe-horning applications into the DOM is not going to end because wasm has access to it. This also seems like a classic way to have the entire industry misunderstand a technology, misapply it, and again, continue the pain of building applications on top of html with JavaScript/wasm. Sorry for that rant, but I went into panic mode when I saw your question. It reminds me of how everyone misunderstood smalltalk/OOP because they saw on it in terms of the existing paradigm. The misunderstanding pretty much cut us off from the real benefits of the idea because we got distracted writing classes and abstractions instead of passing around code with data across the network. Maybe I'm off base here but my fear is that people see wasm new/cool/shiney and use it instead of JavaScript, and in the ensuing hype we lose the most valuable aspects of the technology (as partially demonstrated by Spin).
- cercatrova 5y agoThat's fine, I use Flutter which eschews the DOM and uses the canvas to build applications, but people don't seem to like that very much since it's not as introspectable as HTML, CSS and JS. So if WASM had DOM access, people could build their apps on whatever language they wanted to, that would compile to WASM which would then manipulate the DOM. That way people don't have to use JS. If WASM couldn't manipulate the DOM, then that's also fine, it'd just have to manipulate a canvas element or something similar like Flutter and Skia does.