WASI Preview 2 represents a major milestone for WASI. It marks the moment when WASI has fully rebased on the Wit IDL and the component model type system and semantics, making it modular, fully virtualizable, and accessible to a wide variety of source languages.
WASI Preview 2 is also known as “WASI 0.2”, and corresponds to versions
numbered 0.2.x
in Wit packages and related identifiers. It is also known as
“WASIp2”, where the “p” stands for either “preview” or “point”.
WASI Preview 2 contains the following APIs:
Proposal | Versions |
---|---|
wasi-io | 0.2.0 |
wasi-clocks | 0.2.0 |
wasi-random | 0.2.0 |
wasi-filesystem | 0.2.0 |
wasi-sockets | 0.2.0 |
wasi-cli | 0.2.0 |
wasi-http | 0.2.0 |
The portability criteria of the WASI Preview 2 proposals were met by the following implementations, which were demonstrated to be interoperable by each passing [Wasmtime's WASI Preview 2 test suite][test-suite].
We plan to promote the Preview 2 test suite to live in the wasi-testsuite project soon, and add more interoperable implementations to this list when they are complete.
To be included in Preview 2, a proposal must:
- Reach phase 3 in the WASI Subgroup Phase Process
- Satisfy its own portability criteria
- Be voted for inclusion by the WASI Subgroup
Proposals may be added to WASI Preview 2 at any time until WASI Preview 3 is launched.
Witx files can be derived from Wit files according to the Canonical ABI. Wasm engines can implement single-module components using just these derived Witx files and their existing Witx machinery.
The component model is expected to add future
and stream
keywords, which
will provide integrated and composable async
functionality. WASI Preview 3 is
planned to be a major revision of the Preview 2 APIs using these new features
in place of wasi-io's streams and polling interfaces. It's also expected to
incorporate lessons learned from implementation and user experience with
Preview 2.
When Preview 3 is launched, implementations may continue to support Preview 2, either by implementing Preview 3 along side it, or by virtualizing (polyfilling) Preview 2 in terms of Preview 3.
The release criteria of Preview 3 will include that performance will be measured and addressed.