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

Evaluate compatibility between WASI snapshot 1 and next #263

Closed
codefromthecrypt opened this issue Feb 18, 2022 · 7 comments · Fixed by #610
Closed

Evaluate compatibility between WASI snapshot 1 and next #263

codefromthecrypt opened this issue Feb 18, 2022 · 7 comments · Fixed by #610

Comments

@codefromthecrypt
Copy link
Contributor

Per WebAssembly/WASI#215 (comment) I found this is the new WASI API in progress

https://github.com/WebAssembly/wasi-filesystem/blob/main/wasi-filesystem.wit.md

Let's check to see if there are signature incompatibilities before we decide if and how to export a WASI go interface

@codefromthecrypt
Copy link
Contributor Author

WebAssembly/WASI#469 (comment) also is interesting as the "rights" concept is being dumped. We should avoid implementing that, but this also hints the new WASI is a different API

@codefromthecrypt
Copy link
Contributor Author

codefromthecrypt commented May 11, 2022

found this which hints the next will be named "wasi_snapshot_preview2" https://github.com/sunfishcode/wasi-wiki/wiki/Preview2-Plan

I perused the types and to best of my knowledge they aren't using anything fancy like i128 or externref @sunfishcode can you confirm?

@sunfishcode
Copy link

Yes, that proposal is using the component model's set of types which doesn't include 128-bit integer types, and the Canonical ABI, which doesn't use externref.

@codefromthecrypt
Copy link
Contributor Author

thanks a lot for the clarification! @sunfishcode

@codefromthecrypt
Copy link
Contributor Author

One major change is the decentralization of specs. For example, there's a subspec for clocks and no shared errno. However, as WASI doesn't require the component module, a monolithic module import as hinted earlier seems implied.

https://github.com/WebAssembly/wasi-clocks/blob/main/wasi-clocks.abi.md
https://github.com/WebAssembly/component-model/blob/main/design/high-level/FAQ.md#how-does-wasi-relate-to-the-component-model

@sunfishcode a couple more questions, just so we can know where to subscribe.

  • do you know which repo or file inside it will track non-component use of new WASI (Ex a monolithic "wasi_snapshot_preview2" import)?
  • do you know any implementation that has started work on any of the new WASI components?

@sunfishcode
Copy link

One major change is the decentralization of specs. For example, there's a subspec for clocks and no shared errno.

That's right. Avoiding a single shared errno makes it easier for APIs to offer more descriptive error values. I expect wasi-libc will convert various API's errors into a shared errno, for POSIX compatibility.

However, as WASI doesn't require the component module, a monolithic module import as hinted earlier seems implied.

https://github.com/WebAssembly/wasi-clocks/blob/main/wasi-clocks.abi.md https://github.com/WebAssembly/component-model/blob/main/design/high-level/FAQ.md#how-does-wasi-relate-to-the-component-model

@sunfishcode a couple more questions, just so we can know where to subscribe.

* do you know which repo or file inside it will track non-component use of new WASI (Ex a monolithic "wasi_snapshot_preview2" import)?

The component-model repo, which also covers the Canonical ABI, which is the basis for non-component versions of component interfaces. And the wit-bindgen repo, which is where the main implementation of the Canonical ABI is being developed.

* do you know any implementation that has started work on any of the new WASI components?

It's possible to implement wit interfaces using Wasmtime and wit-bindgen, and various people are doing this today. I plan to start work on Wasmtime implementations of the new wasi-filesystem and other new APIs soon.

@codefromthecrypt
Copy link
Contributor Author

Thanks @sunfishcode I'll follow the component model repo for any updates on this, and thanks for the hints meanwhile!

codefromthecrypt pushed a commit that referenced this issue Jun 1, 2022
The componentized successor to wasi_snapshot_preview1 is not compatible
with the prior imports or even error numbers. Before releasing wazero
1.0 we need to change this package to reflect that WASI 2 is effectively
  a different API.

Fixes #263

Signed-off-by: Adrian Cole <adrian@tetrate.io>
codefromthecrypt added a commit that referenced this issue Jun 1, 2022
The componentized successor to wasi_snapshot_preview1 is not compatible
with the prior imports or even error numbers. Before releasing wazero
1.0 we need to change this package to reflect that WASI 2 is effectively
  a different API.

Fixes #263

Signed-off-by: Adrian Cole <adrian@tetrate.io>
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

Successfully merging a pull request may close this issue.

3 participants