3 ms·
Simply put, missing DOM manipulation. Here [0] is quite a good summary with plenty of links to currently open proposals/issues on WA's GitHub that would allow i
by klohto 4y ago
Simply put, missing DOM manipulation.
Here [0] is quite a good summary with plenty of links to currently open proposals/issues on WA's GitHub that would allow it to do that.
[0]https://sudonull.com/post/62869-WebAssembly-and-DOM-manipulation https://sudonull.com/post/62869-WebAssembly-and-DOM-manipula...
- torginus 4y agoHmm, wouldn't it suffice just to export a createHandle() function to WASM, which could then use said handle to reference the underlying C++ object of the HTML element. V8's involvement isn't even necessary. The DOM element then would be collected, when there are no JS references to it, its handle is disposed of by the WASM code, or the WASM runtime itself is destroyed. Seems like a very similar problem to how game engines integrate scripting languages like Lua - with very similar solutions.
- dmitriid 4y agoGame engines are aware of the scripting languages embedded in them. Browsers are largely unaware of anything but Javascript. On top of that a lot of DOM manipulation is smoke and mirrors. While the exposed DOM APIs may provide you with some object, internally it's likely to be a collection of weird things in a trench coat due to all the optimisations that browser engines are doing. And no one in their right mind will give you raw access to the underlying C++ object for many reasons, security being number one. And 30 years of assumptions that browsers have about these objects being number two.