Description
There is a proposal to allow imported functions returning a Promise, and thereby suspending WASM execution, essentially turning the entire WASM call into a Promise: https://github.com/WebAssembly/js-promise-integration/blob/main/proposals/js-promise-integration/Overview.md
V8 talks about it here: https://v8.dev/blog/jspi
Is this something that would be easy to modify WASMI to support? I'm guessing it would use the common Rust async API, simmilar to how it's described for JavaScript.
Context This would solve a headache I have (currently using wasm3): I want an event main loop, but once I start WASM, it has to do everything blocking, unless I make the WASM code async. Since WASM is already interpreted and should be trivially re-entrant, it seems the interpreter could do more to help me "get out" again while waiting for I/O. (Running on the second core of RP2040.)