Is there a webassembly API allowing webassembly code to interact with the browser without javascript? Accessing the network, the DOM, and OpenGL, for instance. For OpenGL in particular, it's ridiculous that I have to put every function call through javascript first. There's gotta be an enormous performance penalty associated with that.
If not, are there any plans for such APIs?
Is there a WebAssembly API allowing WebAssembly code to interact with the browser without javascript?
No, currently there is not any such API. Currently WebAssembly can only export / import simple functions from the host environment - these are restricted to using the WebAssembly type system (which only has 4 integer types). For this reason, most people use tooling to generate binding / glue code, e.g. wasm-bindgen.
If not, are there any plans for such APIs?
Yes there are, possibly the most significant is interface types, which is a rich 'language' for describing interfaces, which will allow a much more versatile WebAssembly / host interface without any glue code in the future.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With