Skip to content
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

Support for WASI #258

Closed
skyne98 opened this issue May 17, 2019 · 10 comments
Closed

Support for WASI #258

skyne98 opened this issue May 17, 2019 · 10 comments

Comments

@skyne98
Copy link

skyne98 commented May 17, 2019

Hey there, maybe you guys have heard about the new and shiny WebAssembly WASI standard?

I think it might be very useful to try to add WASI support to rust-zmq. However, I am not sure whether the IPC is supported at all, I am far from being an expert in low-level Linux system calling 😄.

Here are the WASI Core system APIs for reference.

Thanks for your time!

@jedisct1
Copy link
Collaborator

WASI doesn't support network access yet.

You can have pre-opened sockets that a Wasm/WASI app could use, but the app itself cannot listen to a port, initiate a connection or exchange datagrams.

Even sending/receiving data on a preopened socket is not implemented by most runtimes because the way networking will be done in WASI still remains to be designed.

@skyne98
Copy link
Author

skyne98 commented May 17, 2019

@jedisct1 thanks for the insight. What about IPC based communication?

@jedisct1
Copy link
Collaborator

Same.

WebAssembly modules can communicate via their runtime, but there is no standardized interface yet.

@skyne98
Copy link
Author

skyne98 commented May 17, 2019

It seems like a big problem for WASI. It seems to lack mechanisms for arbitrary extensions (Vulkan extensions, e.g.). That means that for every specific case the standard will have to be extended, as well as runtimes.
That sounds really, really slow and problematic.

@jedisct1
Copy link
Collaborator

Give it some time. WASI is still fairly new. Extension mechanisms are being discussed, but providing a consistent API across all runtimes comes with a lot of challenges.

@skyne98
Copy link
Author

skyne98 commented May 18, 2019

Sure, its creators and contributors are making the dream come true at the moment. I acknowledge that there is still a lot of work to do, and we have to be patient or maybe even help.
Also this is what I've been dreaming of since Webassembly was released. Gets me very, very excited about WASI.

@rotty
Copy link
Collaborator

rotty commented May 19, 2019

Since rust-zmq is not a pure-Rust crate, but a binding to libzmq, the prerequisite would be to get libzmq itself to be able to be cross-compiled to WASM and runnable on WASI, which in turn needs UDP socket support in WASI to work.

Once someone can come up with a proof-of-concept application implemented in C, using libzmq directly , which actually runs in WASI, we can investigate support in rust-zmq.

This seems quite a premature feature request to me ;-).

@skyne98
Copy link
Author

skyne98 commented May 19, 2019

@rotty thanks for your reply. Just wanted to put the idea out there, so if someone is interested in it, it can be discussed with slightly more qualified developers 😄

I am constantly watching the changes being made to the standard, as well as runtime support for them. As it was mentioned, WASI code at the moment is only capable of reading and writing from/to open sockets, so i guess we are halfway there already!

@rotty
Copy link
Collaborator

rotty commented May 26, 2019

I think I'll close this now. If someone comes up with a PoC, having a libzmq-based C demo app running on WASI, we can discuss this again in a new issue.

@rotty rotty closed this as completed May 26, 2019
@skyne98
Copy link
Author

skyne98 commented May 26, 2019

I agree 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants