Skip to content
This repository was archived by the owner on Aug 17, 2022. It is now read-only.
This repository was 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

Description

@lachlansneff

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

Activity

  1. fgmccabe commented on Apr 27, 2020

    @fgmccabe
    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.

  2. pchickey commented on Apr 27, 2020

    @pchickey
    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!

  3. lachlansneff commented on Apr 27, 2020

    @lachlansneff
    Author

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

  4. pchickey commented on Apr 27, 2020

    @pchickey
    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions