Reference types

Reference types, currently in Phase 3, form the basis for the host bindings and GC features. The proposal documentation at https://github.com/WebAssembly/reference-types/blob/master/proposals/reference-types/Overview.md describes the addition of a new type, anyref, which can be used as both a value type and a table element type. The anyref type allows you to pass a JavaScript object to a Wasm module. Eberhardt describes the implications of this feature in his blog post:

"The wasm module can't really do much with the object via the anyref type. What's more important is that the module is holding a reference to a garbage collected object on the JS heap, meaning they need to be traced during wasm execution. This proposal is seen as a stepping-stone towards the more significant garbage collection proposal."

There are several other exciting features in the pipeline for WebAssembly. The WebAssembly CG and WG are devoting their time and resources to making these features a reality. You can view all of the proposals at the WebAssembly organization page on GitHub, located at https://github.com/WebAssembly.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset