Intent to Prototype: Stack Switching Promise Integration

345 views
Skip to first unread message

Francis McCabe

unread,
May 26, 2022, 3:33:21 PM5/26/22
to blin...@chromium.org

Contact emails

f...@chromium.org

Explainer

https://github.com/WebAssembly/js-promise-integration/blob/main/proposals/js-promise-integration/Overview.md

Specification

https://github.com/WebAssembly/js-promise-integration/blob/main/proposals/js-promise-integration/Overview.md

Summary

Stack Switching denotes a technology that allows programs to suspend and resume computation. This is an active area that is part of the WebAssembly standards track. See https://github.com/WebAssembly/stack-switching and https://github.com/WebAssembly/meetings/tree/main/stack. This particular feature refers to the integration between JavaScript Promises and stack switching. This is described in more detail in https://docs.google.com/document/d/16Us-pyte2-9DECJDfGm5tnUpfngJJOc8jbj54HMqE9Y/edit#



Blink component

Blink>JavaScript>WebAssembly

Motivation

In order to support responsive applications written using WebAssembly it is necessary to provide functionality that allows WebAssembly programs to be suspended and resumed. The primary initial use case is to allow WebAssembly programs whose source relies on synchronous APIs to use asynchronous APIs that are increasingly common on the Web platform. The Promise integration proposal allows this to be done without changing the WebAssembly specification itself and without allowing JavaScript programs to be suspended (other than via existing async mechanisms).



Initial public proposal

https://github.com/WebAssembly/js-promise-integration/blob/main/proposals/js-promise-integration/Overview.md

Search tags

stack switchingPromise

TAG review



TAG review status

Pending

Risks



Interoperability and Compatibility



Gecko: No signal

WebKit: No signal

Web developers: No signals

Other signals:

WebView application risks

There is a potential that JavaScript applications could attempt to use this API to introduce behaviors not governed by the ecmascript standard. However, the API is designed to mitigate this risk by causing such JavaScript programs to fail to execute (i.e., throw exceptions in such a way as to prevent their use of the API).

There does not appear to be any specific existing API that would be impacted by this proposal.



Debuggability



Is this feature fully tested by web-platform-tests?

No

Flag name

enable-experimental-webassembly-stack-switching

Requires code in //chrome?

False

Tracking bug

https://bugs.chromium.org/p/v8/issues/detail?id=12191&q=owner%3Ame&can=2

Estimated milestones

No milestones specified



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5674874568704000

This intent message was generated by Chrome Platform Status.

--
Francis McCabe
SWE
Reply all
Reply to author
Forward
0 new messages