WebAssembly / interface-types

Other
641 stars 57 forks source link

Any estimate of how long until a browser supports this? #36

Closed trusktr closed 5 years ago

trusktr commented 5 years ago

I'm interested in this feature. If you had to guess, how long would you guess it will take for the first browser to support DOM references inside Wasm?

My guess is 1 to 2 more years. Thoughts?

KronicDeth commented 5 years ago

It is on the agenda for the in-person tomorrow, so more information will be available after that.

jgravelle-google commented 5 years ago

Also: depends on what you mean by "DOM references in wasm"

If you want to manipulate the DOM via C++/Rust, embind and wasm-bindgen work today. I'm not actually sure of the mechanism by which embind works, but wasm-bindgen stores JS references in a JS array and accesses them by index, which can be passed across the wasm boundary.

If you want to pass opaque JS references to wasm, the anyref proposal is mostly(fully?) implemented in V8 today behind an experimental flag. That's currently in Stage 3, and is also on tomorrow's agenda.

If you want this proposal specifically (benefits of which should include stronger typing and improved performance), I think 1-2 years feels about right? Probably 1 year for the first browser to have support behind a flag, and then another year after that for it to be standardized and available everywhere flagless.

pchickey commented 5 years ago

Closing as resolved