5 ms·
> WASM has fairly strict stack/frame rules/types, so arbitrary gotos wouldn't work. kinda funny because golang follows the same idea.
by ramenmeal 9y ago
> WASM has fairly strict stack/frame rules/types, so arbitrary gotos wouldn't work.
kinda funny because golang follows the same idea.
- kodablah 9y agoSo I am curious how the presence of them in WASM would help
- dualogy 9y agoJump-to-arbitrary-address / labels-as-values isn't made available to Go devs by Go-the-language, but seems required by Go-the-runtime+compiler, such as for compiling Goroutines.
- skybrian 9y agoIt sort of does via channels, though. Sending a value to a bufferless channel causes the next goroutine to run (eventually). This looks a bit like a goto if you squint. Go needs multiple stacks and a way to switch to executing a different stack. Web assembly could provide this in a high-level way.