3 ms·
How would you use features like event listeners and other web APIs from client-side mruby? I guess this is a question about WebAssebly in general: does each lan
by choxi 8y ago
How would you use features like event listeners and other web APIs from client-side mruby? I guess this is a question about WebAssebly in general: does each language that gets ported over have to re-implement those APIs?
- rollcat 8y agowasm has something akin to a syscall interface to talk to the JS side, but you can't just call arbitrary JS.
- steveklabnik 8y 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.