News for hackers. Stuff that matters.
Re:CPython's main branch running in the browser with WebAsse... by bkolobara on Monday November 29, 2021 @02:10AM (#29377220)
It's on the embedder (Wasm VM) to provide this functionality. I'm working on a Wasm runtime [0] that is written in Rust and uses stack switching to allow you to call Rust async functions as if they were blocking. This keeps the Wasm bytecode simple (blocking), but at the same time provides high performance i/o.

There is also a proposal to bring stack switching to the browser.

[0]: https://github.com/lunatic-solutions/lunatic

Re:CPython's main branch running in the browser with WebAsse... by dosshell on Monday November 29, 2021 @02:16AM (#29377256)
What is the difference between "stack switching" and a fiber based approach?
Re:CPython's main branch running in the browser with WebAsse... by bkolobara on Monday November 29, 2021 @05:12AM (#29378117)
Fibers are usually implemented with stack switching. It should be the same approach.