Skip to content
New issue

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

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

Already on GitHub? # to your account

Draft: effects based on Typed continuation proposal #52

Closed
wants to merge 1 commit into 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.

@OlivierNicole
Copy link
Collaborator

Things are now happening on the js_of_ocaml repo at ocsigen/js_of_ocaml#1832.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants