Embedding API changes
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- wasm
- Domain
- compilers
Research direction
The requested work is an update to the explainer's appendix; start by reading the existing embedding API and exception-handling extension described there. Done means the appendix sketches SUSPEND, cont_resume, host-function suspensions, payload and parameter-type requirements, and the stated JS API and JSPI consequences.
Written by the indexing model from the issue text.
Description
It would be good to update the explainer with a sketch of how we expect the embedding API given in the appendix to be extended.
Taking inspiration from how the embedding API is extended for exception handling, we can add a new kind of result from func_invoke, SUSPEND a, where a is a continuation address. We can also add a new function cont_resume that behaves exactly like func_invoke, except that it takes a continuation address instead of a function address. Finally, we can allow host functions to result in suspensions, just like we allow them to result in throws. The suspensions need to be able to carry payloads and need to record the types of the parameters necessary to resume the suspending continuation.
This set of changes are sufficient to allow the JS API spec to specify that an error should be thrown when calling an export results in SUSPEND a. It is also sufficient to specify JSPI in terms of core stack switching by having JSPI suspending import wrappers return suspensions to Wasm carrying the suspending promises as payloads and having JSPI promising export wrappers call func_invoke, receive SUSPEND a, then schedule the future resumption of the continuation via cont_resume once the extracted suspending promise is resolved.
- Dominant language
- WebAssembly
- Stars
- 216
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from WebAssembly/stack-switching
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
WebAssembly/stack-switching#156 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
WebAssembly/stack-switching#145 · 4 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
WebAssembly/stack-switching#144 · 4 comments ·
-
JSPI integration Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
WebAssembly/stack-switching#131 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
WebAssembly/stack-switching#128 · 6 comments ·
All issues in WebAssembly/stack-switching
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
internal.h中,漏掉了1个定义。 Open
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
oxc-project/oxc#26944 ·