stack-switching
stack-switching copied to clipboard
Second immediate for `cont.bind`?
In the course of developing the GC extension for Wasm, we eventually settled on having two type immediates for casting instructions. As I recall, the rationale was partly motivated by static analysis and partly by type system considerations. One property that that does preserve is that both the (expected) input stack type and the output stack type for all instructions is determinable from the opcode and the immediates.
Should we do the same for cont.bind
? It has a similar issue now in that there is one type immediate that determines the output type, but the number of arguments to bind is determined from the type of the continuation on the input stack.
Yes! In fact, it is already the case in the reference implementation. The document on this repository is slightly out of date.
We're implementing this proposal now in Wizard. What's the best source of truth to be most up-to-date? (And would you be willing to update the documentation here to match?) Thanks!
I will prioritise updating the document to reflect the state of the reference implementation (resume_throw, cont.new, etc all have type annotations now). I will update it here first https://github.com/wasmfx/specfx/blob/main/proposals/continuations/Explainer.md#binding-continuations and then subsequently merge in with this repository. I will fix the instructions tonight (my time). I will do a larger refactoring of the document later.
I've updated the document on the WasmFX repository now.
Awesome, thanks for the quick turnaround!
Closing, since this seems resolved.