3 ms·
WASM has been at an inflection point for 5 years. Where are we at with garbage collection and DOM access?
by ramesh31 5y ago
WASM has been at an inflection point for 5 years. Where are we at with garbage collection and DOM access?
- smitop 5y ago> garbage collection The draft WASM garbage collection proposal is partially implemented in Chromium, you can try it by enabling the enable-experimental-webassembly-features feature flag. > DOM access WebAssembly will never have direct access to the DOM, but at least with Rust the wasm-bindgen+web_sys crates make interacting with the DOM as simple as it is from JavaScript.
- deleted 5y ago[deleted]
- ducharmdev 5y agoAssuming the GC proposal eventually reaches general availability, do you think the approach of the wasm-bindgen+web_sys crates you mention could serve as a model for garbage-collected languages wishing to serve as a replacement for JavaScript? I know the original intention of WASM was to peacefully coexist with JavaScript, not replace it, but one can dream.
- chrismorgan 5y ago> WebAssembly will never have direct access to the DOM I haven’t been paying much attention to WASM proposals for the last few years, but I thought that direct DOM access (avoiding JavaScript trampolining) was one of the driving goals of the reference type, interface type and garbage collection proposals. https://github.com/WebAssembly/proposals/issues/16 https://github.com/WebAssembly/proposals/issues/16 mentions “call Web APIs (passing primitives or DOM/GC/Web API objects) directly from WebAssembly without calling through JavaScript”, and WASM’s high level goals document <https://github.com/WebAssembly/design/blob/main/HighLevelGoals.md https://github.com/WebAssembly/design/blob/main/HighLevelGoa...> lists “access browser functionality through the same Web APIs that are accessible to JavaScript” (not “through JavaScript”, but “through the same APIs”). Am I misunderstanding things?
- nhoughto 5y agoyep was my thoughts too, WASM solves some problems well. But it isn't and can't replace general containers like Docker does, for some specific workloads sure but not a general solution. And yeah i don't quite think everyone talking about WASM understands its not just 'faster javascript' but a totally different world where you have to for example, BYO GC (or manage memory yourself if you like!).
- wrnr 5y agoGC is the job of the language, Rust doesn't need it
- astrange 5y agoIt does if it wants to interoperate with JS, unless you want to pin all memory when it's in the other runtime.
- ducharmdev 5y agoThis is the question I want answered more than anything. If WASM can get these, there's no doubt that it will completely reshape the future of web development.
- postalrat 5y agoDOM access? why?