Skip to content

## What this adds #62389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ubsasi opened this issue Dec 4, 2022 · 0 comments
Open

## What this adds #62389

ubsasi opened this issue Dec 4, 2022 · 0 comments
Labels
triage needed This issue needs more specific labels

Comments

@ubsasi
Copy link

ubsasi commented Dec 4, 2022

What this adds

Calls out to modules with wasm-opt's --asyncify pass to unwind and rewind the module's call stack when we want to put Swift execution to sleep while allowing incoming events to be handled by JavaScript.

Further Reading

Alon Zakai's Blog
Alon Zakai's Talk
Binaryen Docs
Experimental JS wrapper from Google

Concerns

  • This adds a bit of complexity on the JS runtime side, especially the need to provide a 'restart' method for re-entering module execution. Should not affect existing usage as all additions are optional.
  • At Swift build time, there is no way of knowing if module will be asyncified so no way to block usage of new methods. The Asyncify pass is extremely slow as well, so not a good candidate to add e.g. to carton's build process.

Originally posted by @yonihemi in swiftwasm/JavaScriptKit#107

@LucianoPAlmeida LucianoPAlmeida added the triage needed This issue needs more specific labels label Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage needed This issue needs more specific labels
Projects
None yet
Development

No branches or pull requests

2 participants