5 ms·
wasm has something akin to a syscall interface to talk to the JS side, but you can't just call arbitrary JS.
by rollcat 9y ago
wasm has something akin to a syscall interface to talk to the JS side, but you can't just call arbitrary JS.
- steveklabnik 9y agoTo clarify this a bit, webassembly modules declare external functions they'd like to call. When you instantiate the module, you hook JS functions up to those names. So, you can "call arbitrary JS" in the sense that there's no restrictions on what JS is in those functions, but you can't "call arbitrary JS" in the sense that the module has to list up-front what it'd like to call and it's the instantiator's job to provide those things or decide to not instantiate.