Support stdin/stdout (io-std feature) in WASM #6516
Labels
A-tokio
Area: The main tokio crate
C-feature-request
Category: A feature request.
M-io
Module: tokio/io
T-wasm
Topic: Web Assembly
The
wasm32-wasi
target does support stdio, however Tokio implements stdin/stdout by spawning a new thread and using blocking IO:I did try patching Tokio to allow
io-std
anyway, and as you would expect you get this error:It doesn't give a useful backtrace, but I don't think we need one. WebAssembly doesn't support threads yet so this clearly isn't going to work.
However if you look at the WASI spec, stdin/stdout are
streams
which can return apollable
object which I think means they can work natively with Rust's async support (though I'm a Rust async neophyte so I may be wrong).The text was updated successfully, but these errors were encountered: