-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wasm support #87
Comments
Hello there 👋🏾 I will be glad to help you with this issue! |
@FuriouZz Thank you, help would be very welcome! :) |
Imo blocking executor should just redirect to a normal spawn because it’s easier to convert current code to Wasm. But it should be mentioned in the documentation somewhere. |
For reference, see wasm support in async-std: async-rs/async-std#757 |
@Stupremee Is the blocking executor even used on wasm? I would assume no since there are no files and no stdin/stdout/stderr on wasm, but I could be wrong? |
Maybe it's about WASI ? It would be glad to see WASI is also supported |
@huangjj27 I believe WASI still in development and does not have what we need yet... hopefully soon :) |
I've got a WIP PR #99 where i've started to implement this. At the minute, most things are basically commented out with There's plenty left to do, like actually call some javascript apis to spawn the task and work on e.g. Timer, but people seem interested in contributing from this thread, so I thought I'd start making things public early. |
support for emscripten might be useful, too ((maybe) related: https://users.rust-lang.org/t/how-to-get-tcpstream-to-work-in-wasm/13103/6)... althrough I'm not sure how common emscripten usage is, as of today. |
This is still an issue for me @stjepang ; i'm running on windows with rust 1.47: Ive given it a look but im lost in dependencies :) , any idea? |
It's going to be difficult to implement this before atomics become stable for WASM runtimes. The main blocker is the However, both Wasmtime and Wasmer don't have the best support for atomics right now. When I run |
With the exception of @smol-rs/admins Thoughts on exposing WASM support in this higher level crate? |
It would be nice to use smol in cloudflare worker! It would nice to compose futures around smol's local_executor in their wasm runtime, several of the worker-rs api are derived from web_sys and have async api around them. |
I'm assuming a browser (javascript) environment. Quick thoughts:
Async
will be unusable becauseAsRawFd
/AsRawSocket
types don't exist on wasm.Timer
can be perhaps be implemented by callingsetTimeout()
in javascript.The text was updated successfully, but these errors were encountered: