-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: add wasi-0.3.0
draft
#164
base: main
Are you sure you want to change the base?
Conversation
Followed the example of `wasi-http` and `wasi-clocks` duplicating the package in a subdirectory - Remove `would-block` error code - Replace `wasi:io/error.error` usage by `error-context` - Replace `wasi:io/streams.input-stream` return values by `stream<u8>` in return position - Replace `wasi:io/streams.output-stream` return values by `stream<u8>` in parameter position - Guests should be able to rely on `stream.new` to construct streams - Merge `read{,via-stream}` into a singular `read`. Both functions take an offset as a parameter and since they now return `stream<u8>`, callers can limit the amount of bytes read by using the `stream<u8>` directly, therefore functionality of both is identical - Merge `write{,via-stream}` into a singular `write`. Both functions take an offset and `stream<u8>` as a parameter. It is assumed that `error-context` returned by writes to the stream and reads from the stream are sufficient for error handling. Signed-off-by: Roman Volosatovs <[email protected]>
Same as in WebAssembly/wasi-sockets#111 (comment), removed the |
This seems to be better aligned with latest specification on error context https://github.com/WebAssembly/component-model/blob/cbdd15d9033446558571824af52a78022aaa3f58/design/mvp/Explainer.md#error-context-type > A consequence of this, however, is that components *must not* depend on the > contents of `error-context` values for behavioral correctness. In particular, > case analysis of the contents of an `error-context` should not determine > *error recovery*; explicit `result` or `variant` types must be used in the > function return type instead (e.g., > `(func (result (tuple (stream u8) (future $my-error)))`). Signed-off-by: Roman Volosatovs <[email protected]>
f1cc147
to
a7b76d0
Compare
WebAssembly/wasi-filesystem#164 (comment) Signed-off-by: Roman Volosatovs <[email protected]>
WebAssembly#164 (comment) Signed-off-by: Roman Volosatovs <[email protected]>
e60c2bf
to
0a23094
Compare
WebAssembly#164 (comment) Signed-off-by: Roman Volosatovs <[email protected]>
0a23094
to
81bd8bb
Compare
WebAssembly/wasi-filesystem#164 (comment) Signed-off-by: Roman Volosatovs <[email protected]>
Thanks for putting this together! Overall this looks good. One additional thing we should look into is translating Similar to this discussion in wasi-sockets, what would you think about renaming
Could we simplify this interface by eliminating the outer |
Signed-off-by: Roman Volosatovs <[email protected]>
Signed-off-by: Roman Volosatovs <[email protected]>
07e2d44
to
eed891a
Compare
Signed-off-by: Roman Volosatovs <[email protected]>
eed891a
to
70fa400
Compare
This ensures that e.g.: ``` wit-bindgen markdown wit-0.3.0-draft -w imports --html-in-md ``` works with wit-bindgen 0.37 refs: WebAssembly/wasi-sockets@3abda6e refs: WebAssembly/wasi-sockets#111 (comment) Signed-off-by: Roman Volosatovs <[email protected]>
Refs https://github.com/orgs/bytecodealliance/projects/16/views/1?pane=issue&itemId=88153596
Refs WebAssembly/wasi-sockets#111
Refs #156 (change sets seem to be complimentary)
Followed the example of
wasi-http
andwasi-clocks
duplicating the package in a subdirectoryThis vendors
wasi-clocks
from WebAssembly/wasi-clocks#77would-block
error codewasi:io/error.error
usage byerror-context
wasi:io/streams.input-stream
return values bystream<u8>
in return positionwasi:io/streams.output-stream
return values bystream<u8>
in parameter position - Guests should be able to rely onstream.new
to construct streamsread{,via-stream}
into a singularread
. Both functions take an offset as a parameter and since they now returnstream<u8>
, callers can limit the amount of bytes read by using thestream<u8>
directly, therefore functionality of both is identicalwrite{,via-stream}
into a singularwrite
. Both functions take an offset andstream<u8>
as a parameter.It is assumed that
error-context
returned by writes to the stream and reads from the stream are sufficient for error handling.See also