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

Function coloring? #42

Closed
pannous opened this issue Nov 8, 2023 · 3 comments
Closed

Function coloring? #42

pannous opened this issue Nov 8, 2023 · 3 comments

Comments

@pannous
Copy link

pannous commented Nov 8, 2023

Does this approach avoid function coloring? That is: do legacy calls of functions containing yield instructions just treat these as nop?

@rossberg
Copy link
Member

rossberg commented Nov 8, 2023

Neither. We definitely don't want function coloring, i.e, a static effect system. But stack switching does not need that. In all variants of the proposal circulated so far switching stacks works without static knowledge of such effects. In fact, that is a main point of the proposal, because in the presence of such knowledge, you can already implement the equivalent semantics producer-side, e.g., through partial CPS conversions, or the approach taken by Asyncify.

@dead-claudia
Copy link

Does this approach avoid function coloring? That is: do legacy calls of functions containing yield instructions just treat these as nop?

@pannous For a simpler answer: It's based on (a variant of) continuations. Continuations color runtime contexts, not functions.

As for suspend outside a typed continuation, it would trap at rumtime.

dhil added a commit that referenced this issue Aug 2, 2024
Merge with WebAssembly/spec
@tlively
Copy link
Member

tlively commented Aug 27, 2024

Closing this as answered, but feel free to reopen if there are follow-up questions.

@tlively tlively closed this as completed Aug 27, 2024
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

No branches or pull requests

4 participants