#809: WebAssembly JavaScript Promise Integration API

Visit on Github.

Opened Jan 24, 2023

Wotcher TAG!

I'm requesting a TAG review of JSPI.

The WebAssembly JavaScript Promise Integration (JSPI) API is a standard-track effort of the WebAssembly WG (via its CG) to allow WebAssembly applications to access asynchronous APIs, under the constraint that the only changes are to the JS API and not to core WebAssembly (or to JavaScript)

  • Explainer
  • Specification URL: spec url
  • Tests: wpt
  • User research: [url to public summary/results of research]
  • Security and Privacy self-review²: url
  • GitHub repo (if you prefer feedback filed there): url
  • Primary contacts (and their relationship to the specification):
  • Organization(s)/project(s) driving the specification: WebAssembly CG
  • Key pieces of existing multi-stakeholder review or discussion of this specification: see explainer
  • External status/issue trackers for this specification (publicly visible, e.g. Chrome Status): see chrome status

Further details:

  • [ x] I have reviewed the TAG's Web Platform Design Principles
  • Relevant time constraints or deadlines: There is no specific deadline; however, a second browser implementation is anticipated in 2023H1.
  • The group where the work on this specification is currently being done: WebAssembly Community Group
  • The group where standardization of this work is intended to be done (if current group is a community group or other incubation venue): WebAssembly Working Group
  • Major unresolved issues with or opposition to this specification: none
  • This work is being funded by:

You should also know that...

  1. The purpose of this API is to allow WebAssembly applications originally written against synchronous APIs to work with APIs that are mostly asynchronous in nature (i.e., Web APIs). WebAssembly code is typically compiled from languages like C++ that do not have a rich history of asynchronous functionality.
  2. We have been careful in the design to not require any changes to either the JavaScript language or the WebAssembly instruction set.
  3. We have been careful to constrain the design in such a way that JavaScript applications cannot use JSPI to implement alternate suspension mechanisms to those already part of the Web ecosystem. (I.e., JS programs cannot use JSPI to suspend themselves.)
  4. This is part of a larger effort to bring coroutining capabilities to WebAssembly. However, this is not dependent on those efforts and also has benefits that do not rely on 'core' stack switching.

We'd prefer the TAG provide feedback as (please delete all but the desired option):

☂️ open a single issue in our GitHub repo for the entire review. Note, if appropriate, it is also possible to initiate discussion topics on the repo

Discussions

2023-03-27

Minutes

Rossen: this is big. They ticke the boxes - multistakeholder - questionnaire, etc... however there are some differences between WASM and JS promises... interop between the two is unclear... They say JS already has promise...

2023-04-10

Minutes

punt to plenary

2023-07-mos-eisley

Minutes

Tess to read & make comments.

2023-08-21

Minutes

Rossen: will work this week on it with Sangwhan.

2023-09-04

Minutes

Sangwhan: I will reach out to TC39 folks to discuss this / we can also discuss at TPAC.

2024-01-london

Minutes

Sangwhan: it's big.

Yves: similar in spirit to the work adding hooks for web assembly. More complext for the promise thing

Martin: sounds like they're looking at 2 ways of handling promises. One being essentially freezing the web assembly for a period while the promise goes off and does its business. The other is nativey having some sort of async system.

Sangwhan: suspending part is uncontentious... Latter I don't have any expertise on

Amy: we've been bumping this to a year.. do we need a focused breakout this week?

Sangwhan: we need someone dedicated for web assembly / tc39 stuff

Martin: I won't have time to get up to speed in the next 24 hours

Amy: see what everyone else thinks. Useful to have someone come to one of our calls and talk us through it?

Sangwhan: Maybe. We'd have to read up a bit on the context.

2024-03-18

Minutes

[We talked about the general lack of WASM expertise currently on the TAG]

Tess: could be a good example to bring up in this week's AB/TAG joint meeting re: how to fill the appointed TAG seats

2024-04-22

Minutes

Lea posted in #tag-all to see if one of our illustrious former colleagues has the right background to review this.

2024-08-26

Minutes

Jeffrey: my impression is that this gets discussed across engines in the WASM CG and WG... they do a good job in catching stuff. I suspect that in general we should be declining... Like "we trust the web assembly group"... at some point maybe they will step into an arch issue... but this doesn't strike me as worrying...

Jeffrey to review and propose to close as decline if appropriate

Thank you @fgmccabe for bringing this to us, and we apologize for taking so long to respond to it. We appreciate the work to integrate Promises into Web Assembly. We think the Web Assembly CG is/has been the right place to review it, so we're going to decline the review here.