Skip to content

Thoughts on js-promise-integration #1050

Closed
@tommie

Description

@tommie

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions