Comment by titzer
7 hours ago
> Adding continuation marks and delimited continuations require adding a CPS-pass.
Have you considered targeting the stack switching proposal?
7 hours ago
> Adding continuation marks and delimited continuations require adding a CPS-pass.
Have you considered targeting the stack switching proposal?
Another idea, wasm_of_ocaml [1] compiles effects using either a CPS transform or the JS Promise integration proposal for Wasm [2].
[1]: https://github.com/ocsigen/js_of_ocaml/blob/1b1fcf7b06c12324... [2]: https://github.com/WebAssembly/js-promise-integration/blob/7...
Maybe. My main problem is to get light-weight support for continuation marks.
If I need a CPS-pass for continuation marks, I might as well use it for continuations as well.
It would be great if it were possible to avoid a CPS-pass though.
With stack-switching you won't (shouldn't?) need a CPS pass.
I need to study the stack-switching proposal in more detail.
However, I don't see an obvious way of attach and probe continuation marks to the continuations (including the current one).
I am not an expert in continuation marks, so I'll just link to this presentation by Matthew Flatt (which you probably already know).
https://github.com/WebAssembly/meetings/blob/main/stack/2021...