Skip to content
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

Document the JSPI extension too #15

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

jmid
Copy link
Collaborator

@jmid jmid commented Dec 1, 2023

The little PR documents the current 'effect handler' setup, including the JSPI extension.

One can enable the CPS transformation from `js_of_ocaml` by passing the
`--enable=effects` flag. Without the flag `wasm_of_ocaml` will instead emit code
utilizing
- [the JavaScript-Promise Integration extension](https://github.com/WebAssembly/js-promise-integration/blob/main/proposals/js-promise-integration/Overview.md)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like we can name things better here. I understand reading this comment that effects are enabled by default and the choice here is whether to use jspi or cps. So --enable=effects option feels like a misnomer. Would it be better to change the behaviour such that there are two options --enable=effects_cps and --enable=effects_jspi with --enable=effects_jspi being the default behaviour?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, I have just reused the flag that enables the CPS transformation in Js_of_ocaml.
But indeed, we should use a better name at some point. Probably even have a specific flag: --effects=cps/jspi/double-translation.

@vouillon vouillon merged commit c4ad40d into ocaml-wasm:main Dec 4, 2023
2 checks passed
@jmid jmid deleted the mention-jspi-extension branch December 4, 2023 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants