News for hackers. Stuff that matters.
Re:Ruby on WebAssembly by choxi on Sunday April 29, 2018 @01:23PM (#16952913)
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?
Re:Ruby on WebAssembly by rollcat on Sunday April 29, 2018 @03:03PM (#16953377)
wasm has something akin to a syscall interface to talk to the JS side, but you can't just call arbitrary JS.
Re:Ruby on WebAssembly by steveklabnik on Sunday April 29, 2018 @05:48PM (#16954096)
To 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.