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

Draft: effects based on Typed continuation proposal #52

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vouillon
Copy link
Collaborator

No description provided.

@vouillon vouillon force-pushed the native-effects branch 2 times, most recently from 9648cfb to 8fefdf3 Compare July 16, 2024 15:25
@kayceesrk
Copy link
Collaborator

Exciting. Which engine do you have in mind for experimentation? CC @dhil.

@dhil
Copy link

dhil commented Jul 17, 2024

Nice! We should be able to run this with https://github.com/wasmfx/wasmfxtime using the options wasmtime run -W=exceptions,function-references,typed-continuations file.{wast,wat,wasm} (you may want to build with cargo build --features=unsafe_disable_continuation_linearity_check to avoid materialising continuation objects as we do not garbage collect them yet). I am happy to help experiment with this and use it to performance tune our engine too (we need more benchmarks).

@kayceesrk
Copy link
Collaborator

Does https://github.com/wasmfx/wasmfxtime have GC support now?

@dhil
Copy link

dhil commented Jul 17, 2024

Does https://github.com/wasmfx/wasmfxtime have GC support now?

The support is not complete yet. We are keeping in sync with upstream, where the GC support is being implemented. I think the structures are in place, so it should be possible to compile to it, but I don't think there is any actual runtime garbage collection yet.

@vouillon
Copy link
Collaborator Author

I did this a while ago when some basic support for typed continuations was added in binaryen, which allows to validate the Wasm code.

My motivation was mostly to have a feel of what an implementation of Ocaml effect handlers would look like.

I did not have any engine in mind for experimentation. One issue is that we rely quite a lot on JavaScript to implement some runtime features (like I/Os) at the moment.

@dhil
Copy link

dhil commented Jul 17, 2024

I did this a while ago when some basic support for typed continuations was added in binaryen, which allows to validate the Wasm code.

My motivation was mostly to have a feel of what an implementation of Ocaml effect handlers would look like.

I did not have any engine in mind for experimentation. One issue is that we rely quite a lot on JavaScript to implement some runtime features (like I/Os) at the moment.

Presumably we can link in some WASI in place of the JS?

@kayceesrk
Copy link
Collaborator

kayceesrk commented Jul 23, 2024

@titzer suggested that we target https://github.com/titzer/wizard-engine. Wizard supports GC proposal, and the stack switching through typed continuations is in development: titzer/wizard-engine#175.

There is still the challenge of reliance on JS for runtime system features.

@vouillon
Copy link
Collaborator Author

We can probably develop a minimal runtime which is just able to support some effect benchmarks. That should not be too much work.

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