-
Notifications
You must be signed in to change notification settings - Fork 699
Closed
Labels
asyncstack switching, JSPI, async, green threads, coroutinesstack switching, JSPI, async, green threads, coroutines
Description
Many JavaScript libraries are async and I have not seen that WebAssembly supports promises yet.
In order to easily write performant applications that leverage the JS ecosystem I'd suggest to add support of promises in imported functions.
For instance this should work:
const importObject = {
returnOneAsync: () => new Promise(done => done(1))
};extern "C" int returnOneAsync();
int main(){
int x = returnOneAsync(); // should suspend main until promise resolved.
return x+x;
}rahbari, wiktor-k, torralbaa, raviqqe and emil14
Metadata
Metadata
Assignees
Labels
asyncstack switching, JSPI, async, green threads, coroutinesstack switching, JSPI, async, green threads, coroutines