CPython's main branch running in the browser with WebAssembly
One of the painful aspects of WASM is there's no blocking calls. You can't say "wait for the next event;" instead you must return to the outermost event loop, and wait to be called back.<p>How does Python-in-WASM work around that? For example, how does `for line in sys.stdin:` work if you can't actually block on stdin?<p>Emscripten has some support for this via the "asyncify" transform, which layers additional control flow to enable return all the way up the call stack, and then "rewind" back down into it. But this bloats the code (and is also buggy) so maybe it's not being used.