Skip to content
This repository has been archived by the owner on Aug 17, 2022. It is now read-only.

Define how Promise/Future/etc should interact with interface types #111

Open
lachlansneff opened this issue Apr 27, 2020 · 4 comments
Open

Comments

@lachlansneff
Copy link

There are many apis that return values asynchronously. The browser is obviously a prime suspect, but many native apis could be simplified with a promise/future-like abstraction.

For example, WebGPU uses promises quite liberally and to use it efficiently through wasm (for example, if one was to add it as an extension to wasi), promises would have to be a well-defined with respect to interface types.

Callbacks are an obvious shoo-in. A poll-like api that's abi-specific is another option. (wasi's poll_oneoff for example).

@fgmccabe
Copy link
Contributor

Handling callbacks (sic) is an explicit aim of the interface types proposal.
At the moment, there is no specific plans to specifically support promises; we imagine that there may be additional lifting needed for higher-level concepts.

@pchickey
Copy link
Collaborator

We've frequently come up against needing some sort of promise/future type in wasi, for both better web platform integration, and in order to make existing functions like poll_oneoff extensible by other wasi interfaces. There's been some informal discussions of various designs, we haven't had time to prototype solutions to it yet. If you'd like to help with this in the context of wasi, lets talk!

@lachlansneff
Copy link
Author

@pchickey Is there a chatroom where these discussions are occuring?

@pchickey
Copy link
Collaborator

I think so far most of the discussion was in person or on zooms between fastly and mozilla folks, but we all hang out in the bytecodealliance zulip these days

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants