Stream: wasmtime

Topic: Mio/Wasip2


view this post on Zulip Ashanti Mutinta (Jan 12 2026 at 16:53):

Hello, was wondering if this planned to be merged? https://github.com/tokio-rs/mio/pull/1836

This implementation currently uses a mix of POSIX-style APIs (provided by wasi-libc via the libc crate) and WASIp2-native APIs (provided by the wasi crate). Alternatively, we could implement Select...

view this post on Zulip Joel Dice (Jan 12 2026 at 17:03):

That's up to the mio maintainers. So far, the feedback has been that it won't be accepted as-is, but nobody has come up with an alternative approach that would be accepted.

My current thinking is that once wasi-libc has wasm32-wasip3 + pthread support, mio can treat it as just another POSIX platform via poll. That won't be particularly efficient, but has the advantage of minimal maintenance effort for the mio team.

view this post on Zulip Ashanti Mutinta (Jan 12 2026 at 17:16):

Okay I see. This and socket2 would really unlock a lot of crates but I understand their concerns. Thank you for the response

view this post on Zulip Pat Hickey (Jan 12 2026 at 17:33):

while mio is a prerequisite, its worth noting that until shared-everything-threads or stack-switching wasm standard proposals stabilize, it won't be possible to make a fully functional port of tokio to webassembly, because tokio::task::spawn_blocking requires some sort of stack switching or thread creation primitive that webassembly does not have.

view this post on Zulip Joel Dice (Jan 12 2026 at 17:40):

Pat Hickey said:

shared-everything-threads or stack-switching wasm standard proposals

or the cooperative multi-threading support coming in WASIp3, which is already implemented in Wasmtime.

view this post on Zulip Joel Dice (Jan 12 2026 at 17:41):

and which @Sy Brand is adding support for in wasi-libc.

view this post on Zulip Pat Hickey (Jan 12 2026 at 17:41):

oh! right, thank you. I forgot about that

view this post on Zulip Ashanti Mutinta (Jan 12 2026 at 17:46):

Awesome, will keep a lookout for it. For my usecase I figured I would be able to get away with current_thread but aligning with the current tokio socket api would be really cool as well.

Looking forward to preview 3

view this post on Zulip Pat Hickey (Jan 12 2026 at 17:59):

some use cases may get away with spawn_blocking being unimplemented!() but its use is a pretty infectious assumption of many tokio-dependent crates (e.g. reqwest)

view this post on Zulip Ashanti Mutinta (Jan 12 2026 at 18:26):

Ah I see! Okay I will wait patiently. Thank you again

view this post on Zulip Ashanti Mutinta (Jan 13 2026 at 17:19):

Also don't know if its appropriate to share here but started working on an async runtime last year. Pretty barebones right now but makes me really excited about preview 3. Uses a lot of poll mechanics right now

https://tangled.org/staticanxiety.tngl.sh/tiny-wasm-async-runtime for anyone even interested

Moved my tiny async preview 2 runtime here

view this post on Zulip Ralph (Jan 13 2026 at 17:33):

this is cool!!!!

view this post on Zulip Ashanti Mutinta (Jan 13 2026 at 17:36):

Thank you so much!

view this post on Zulip Ralph (Jan 13 2026 at 17:49):

what are you doing with it? having fun, or for some purpose?

view this post on Zulip Ashanti Mutinta (Jan 13 2026 at 17:50):

Mostly just having fun with it. After Yoshua's post and reading a bit of smol I was really interested into seeing how they work. Once spawn is implemented, I would love to have multiple threads running, I think it would be really interesting

view this post on Zulip Ralph (Jan 13 2026 at 17:51):

you're not wrong!


Last updated: Jan 29 2026 at 13:25 UTC