| Minor clarification: The DOM builtins should be helped by the Reference Types Proposal for WebAssembly. [1] `The host bindings proposal` is going to help speed up new and getter/setter calls. [2] 1:
`Currently the only built-ins that we support this for are mostly limited to the math built-ins. That’s because WebAssembly currently only has support for integers and floats as value types. That works well for the math functions because they work with numbers, but it doesn’t work out so well for other things like the DOM built-ins. So currently when you want to call one of those functions, you have to go through JavaScript. That’s what wasm-bindgen does for you. But WebAssembly is getting more flexible types very soon. Experimental support for the current proposal is already landed in Firefox Nightly behind the pref javascript.options.wasm_gc. Once these types are in place, you will be able to call these other built-ins directly from WebAssembly without having to go through JS.` -- https://github.com/WebAssembly/reference-types 2: `there are still a couple of built-ins where you will need to go through JavaScript. For example, if those built-ins are called as if they were using new or if they’re using a getter or setter. These remaining built-ins will be addressed with the host-bindings proposal.` -- https://github.com/WebAssembly/host-bindings (BTW I could be mistaken, just quoting the article) |