Re:WebContainers: Run Node.js natively in the browser
by slver on Thursday May 20, 2021 @06:11PM
(#27228057)
> WASM can't even talk to the DOM API directly
For now. It's planned.
Re:WebContainers: Run Node.js natively in the browser
by mr_toad on Thursday May 20, 2021 @10:14PM
(#27229793)
For existing code bases that don’t already do DOM manipulation (so, all of them) other parts of the Web API might be more useful, like the canvas, the video API, the RTC API etc.
Re:WebContainers: Run Node.js natively in the browser
by slver on Friday May 21, 2021 @12:10AM
(#27230414)
The issue in general is how to bridge these JS OOP APIs to something that's basically assembler.
If WASM gains a foreign object model calling convention or whatever, we're in game.
Re:WebContainers: Run Node.js natively in the browser
by emteycz on Friday May 21, 2021 @08:09AM
(#27233007)
Wasm is not basically assembler, it's (going to be) very high level:
- https://github.com/WebAssembly/reference-types
- https://github.com/webassembly/threads
- https://github.com/WebAssembly/exception-handling
- https://github.com/WebAssembly/function-references
- https://github.com/WebAssembly/gc
Though it is true that the original MVP was very barebone and could be compared to assembler. However, the reference types proposal has been shipped in all major browsers and is considered "finished".
Re:WebContainers: Run Node.js natively in the browser
by pjmlp on Friday May 21, 2021 @02:10AM
(#27231012)
That was the idea, the world decided otherwise based on the Flash and Silverlight experience versus clunky Web.
https://developer.mozilla.org/en-US/docs/WebAssembly/Concept...
> WebAssembly is a different language from JavaScript, but it is not intended as a replacement. Instead, it is designed to complement and work alongside JavaScript, allowing web developers to take advantage of both languages' strong points
"Not intended as a replacement"
WASM is a math coprocessor for JS. WASM can't even talk to the DOM API directly (which is the API you use to build web pages in JS); you have to write JavaScript glue code for any/all I/O in WASM.