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

WASI: Split networking into a module #69

Closed
npmccallum opened this issue Mar 27, 2019 · 4 comments
Closed

WASI: Split networking into a module #69

npmccallum opened this issue Mar 27, 2019 · 4 comments
Labels
wasi:api Issues pertaining to the WASI API, not necessarily specific to Wasmtime.

Comments

@npmccallum
Copy link
Member

Please make networking its own module.

@sunfishcode sunfishcode added the wasi:api Issues pertaining to the WASI API, not necessarily specific to Wasmtime. label Mar 27, 2019
@sunfishcode
Copy link
Member

Currently there are only three networking-specific functions in WASI Core -- sock_send, sock_recv, and sock_shutdown. I have an idea for how we can merge sock_send and sock_recv with fd_write and fd_read (brief mention here), since they're very similar, and I believe would make the API more flexible and easier to understand.

If we do that, a possible path forward here is to also rename sock_shutdown to fd_shutdown and say that WASI Core doesn't have explicit networking support -- it just has support for reading, writing, and (partially) shutting down streams, which can either be byte-oriented or datagram-oriented (and may or may not have in-order delivery, etc.). These might be connected to TCP or UDP sockets, or they might be connected to UNIX-domain sockets, or perhaps even something like TLSSock, or other things. The WASI Core API would limit itself to generic stream/datagram functionality. Creating and configuring (bind, connect, accept, setsockopt, etc.) sockets, or accessing protocol-specific features (sendmsg, recvmsg, etc.), would be handled by a different API module.

What do you think of that approach?

@npmccallum
Copy link
Member Author

I'm all for innovation. But first watch this talk: https://www.youtube.com/watch?v=za41nQ6Ein8 :)

I do think it makes sense to consolidate send()/write() and recv()/read(). However, there may be subtle differences. We should first learn why the fence is there.

In general, I'm strongly in favor of modularizing and versioning the APIs by integrating with the WASM module system (see #74). This means we aren't stuck with the bad decisions we make today.

@sunfishcode
Copy link
Member

Yep :-). I've done some research and know quite a lot about why this particular fence is here, and even some of the accidental consequences it has. I'll write more about it when I make the actual proposal.

@sunfishcode
Copy link
Member

Merging send/recv into read/write is now being tracked in WebAssembly/WASI#4.

howjmay pushed a commit to howjmay/wasmtime that referenced this issue Jan 24, 2022
This avoid having to check both the return from `.GetExport()` and
`.Func()`, and follows after `instance.get_func()` from the Rust API.
pchickey added a commit to pchickey/wasmtime that referenced this issue May 16, 2023
…ytecodealliance#69)

* filesystem: fill in remaining todo'd methods which have wasi-common implementations

* turn on fd_filestat_set, path_rename_dir_trailing_slashes, and symlink_filestat tests, which now pass

* change expect_fail to a function

* filesystem set flags: return Notsup instead of panic
dhil added a commit to dhil/wasmtime that referenced this issue Dec 31, 2023
This patch brings our `Cargo.lock` in sync with the copy of upstream.

Resolves bytecodealliance#69.
dhil added a commit to dhil/wasmtime that referenced this issue Dec 31, 2023
This patch brings our `Cargo.lock` in sync with the copy of upstream.

Resolves bytecodealliance#69.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasi:api Issues pertaining to the WASI API, not necessarily specific to Wasmtime.
Projects
None yet
Development

No branches or pull requests

2 participants