Back to articles

WebAssembly JSPI has a new API

via V8 BlogFrancis McCabe, Thibaud Michaud, Ilya Rezvov, Brendan Dahl

WebAssembly’s JavaScript Promise Integration (JSPI) API has a new API, available in Chrome release M126. We talk about what has changed, how to use it with Emscripten, and what is the roadmap for JSPI. JSPI is an API that allows WebAssembly applications that use sequential APIs to access Web APIs that are asynchronous . Many Web APIs are crafted in terms of JavaScript Promise objects: instead of immediately performing the requested operation, they return a Promise to do so. On the other hand, many applications compiled to WebAssembly come from the C/C++ universe, which is dominated by APIs that block the caller until they are completed. JSPI hooks into the Web architecture to allow a WebAssembly application to be suspended when the Promise is returned and resumed when the Promise is resolved. You can find out more about JSPI and how to use it in this blog post and in the specification . What is new? # The end of Suspender objects # In January 2024, the Stacks sub-group of the Wasm CG v

Continue reading on V8 Blog

Opens in a new tab

Read Full Article
3 views

Related Articles