witx
Parse and validate witx file format
0.9.1
13M downloads/mo
#2740 most downloaded on crates.io
WebAssembly/WASI
What this package is like to depend on
Last release 5 years ago
no release in 18 months
Release timing varies
gaps range from 2 weeks to 5 months
Rarely documented
notes for 2 of 19 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
19 releases · first in 2019
0 releases in the last 12 months
see the full history below
Release timeline
19 releases · Sep 2019 to Jun 2021Releases
latest 19-
0.9.122 Jun 2021Nothing published for this version
-
0.9.018 Feb 2021Nothing published for this version
-
0.8.806 Jan 2021Nothing published for this version
-
0.8.717 Aug 2020Nothing published for this version
-
0.8.623 Jun 2020Nothing published for this version
-
0.8.530 Mar 2020Nothing published for this version
-
0.8.417 Mar 2020Nothing published for this version
-
0.8.326 Feb 2020Nothing published for this version
-
0.8.224 Feb 2020Nothing published for this version
-
0.8.121 Feb 2020Nothing published for this version
-
0.8.018 Feb 2020Nothing published for this version
-
0.7.015 Jan 2020Nothing published for this version
-
0.6.026 Nov 2019Nothing published for this version
-
0.5.012 Nov 2019Nothing published for this version
-
0.4.005 Nov 2019Nothing published for this version
-
0.3.122 Oct 2019Release notes
Open source →Today we’re releasing WASI 0.3.1. This is the first point release in the 0.3.x series, which we’ll be releasing every two months. See the release schedule for all planned releases through 2027.
The highlights for this release are the addition of implements and map<K, V> dependencies in the component model. That means additional expressivity to WIT interfaces. For example: with
implementsit allows a component to import (or export) more than one instance of the same interface under distinct names. We might want to say we aren’t just importing any key-value interface, but more specifically a valkey interface for remote storage and an in-memory cache.map<K, V>brings a first-class associative dictionary type to WIT. This makes it possible to express dynamic sets of keys and values directly from WIT, replacing the previous pattern of needing to writelist<tuple<K, V>>.Starting with 0.3.1, WIT interfaces in WASI are allowed to make use of these features. And both runtimes and toolchains must support these features in order to be compatible with WASI 0.3.1 or later. See our process documentation for more on this.
What's Changed
- Require OCI package available for phase 2 entry by @yoshuawuyts in #938
- Update wasi-gfx to wasi-webgpu by @yoshuawuyts in #939
- Allow re-casing when serializing for transmission by @cceckman-at-fastly in #926
- Document release train by @yoshuawuyts in #945
- Add process for adopting Component Model features by @ricochet in #941
- Adopt Component Model map and implements features for 0.3.1 by @ricochet in #950
New Contributors
- @cceckman-at-fastly made their first contribution in #926
Full Changelog: v0.3.0...v0.3.1
-
0.3.002 Oct 2019Release notes
Open source →WASI 0.3.0
WASI 0.3 is official, and async is now native to WebAssembly Components. The WASI Subgroup voted to ratify WASI 0.3.0, rebasing WASI onto the WebAssembly Component Model's async primitives. These are the detailed release notes, for a high-level overview read the announcement post.
Most of the changes in the 0.3 interfaces are entirely mechanical. WASI 0.2 had to perform some acrobatics to make async work, but now that async is native to the component model we can write the same things we did before but much more ergonomically. Here is a overview of the patterns we were encoding in WASI 0.2 with the
wasi:iopackage, and what those patterns now look like in 0.3 with Component Model async:WASI 0.2 ( wasi:io)WASI 0.3 (Component Model) resource pollablefuture<T>resource input-streamstream<u8>resource output-streamstream<u8>(written-to direction)poll(list<pollable>)awaiton a future (runtime-handled)subscribe()on resourcereturn a future<...>from the callstart-foo/finish-foofoo: async func(...)wasi:cliStructurally the files are the same (
stdin.wit,stdout.wit,stderr.wit,
run.wit,exit.wit,terminal.wit,environment.wit). The interesting
change isstdio.// WASI 0.2 interface stdin { use wasi:io/streams.{input-stream}; get-stdin: func() -> input-stream; } interface stdout { use wasi:io/streams.{output-stream}; get-stdout: func() -> output-stream; } // WASI 0.3 interface stdin { use types.{error-code}; read-via-stream: func() -> tuple<stream<u8>, future<result<_, error-code>>>; } interface stdout { use types.{error-code}; write-via-stream: func(data: stream<u8>) -> future<result<_, error-code>>; }
Note the direction flip on stdout. WASI 0.2 handed you an
output-streamthat you wrote into imperatively. WASI 0.3 has you pass in astream<u8>and get back a future that resolves when the write completes. A small newwasi:cli/typesinterface carries a sharederror-codevariant (io,illegal-byte-sequence,pipe).wasi:socketsThe
networkresource is gone. WASI 0.2 modeled network access as a capability resource threaded through every bind/connect/lookup call. WASI 0.3 removes it entirely; network access is granted via world imports.Every start/finish pair became one
async func. The in-progress intermediate states (bind-in-progress,connect-in-progress,listen-in-progress) and thesubscribe() -> pollablethat drove them are gone:// WASI 0.2 start-bind: func(network: borrow<network>, local: ip-socket-address) -> result<_, error-code>; finish-bind: func() -> result<_, error-code>; start-connect: func(network: borrow<network>, remote: ip-socket-address) -> result<_, error-code>; finish-connect: func() -> result<tuple<input-stream, output-stream>, error-code>; // WASI 0.3 bind: async func(local-address: ip-socket-address) -> result<_, error-code>; connect: async func(remote-address: ip-socket-address) -> result<_, error-code>; listen: async func() -> result<_, error-code>; accept: async func() -> result<tuple<tcp-socket, ip-socket-address>, error-code>;
Note that WASI 0.2's
finish-connectreturned the TCP stream pair inline. In WASI 0.3connectreturns nothing special; byte I/O lives on the socket resource's own stream methods.UDP got the same treatment. The incoming/outgoing datagram stream resources are gone, replaced by plain
async sendandasync receive. Error codes across TCP, UDP, and name-lookup were unified into a singleerror-codevariant, with a newconnection-brokencase and an open-endedother(option<string>)tail.Changes to
wasi:httpThe interface that has seen the most change is
wasi:http. We haven’t just
mechanically converted poll-based interfaces to native async ones, but actually
reorganized the worlds and changed some of the core abstractions.wasi:http
now exposes two worlds:wasi:http/serviceandwasi:http/middleware:interface client { /* ... */ } interface handler { /* ... */ } // When used by guest bindings generators, grant the // ability to make HTTP calls through the `client` import, and // handle incoming HTTP requests through the `handler` export. world service { import client; export handler; } // The middleware world is a super-set of the service world. world middleware { include service; // ← Do everything that `service` can do. import handler; // ← But also pass incoming requests down to another handler. }
The
middlewareworld replaces the 0.2-eraproxyworld, and is used to define HTTP handlers which can forward requests to other handlers. What’s new in WASI 0.3 is that this can now perform service chaining: a pattern where components can be directly composed with one another. This means components acting as microservices that frequently interop with other microservices, do not need to go over the network. Instead a runtime can choose to directly compose them with each other inside the same process. For most microservices this will reduce the time for calling other microservices from milliseconds to nanoseconds: six orders of magnitude.wasi:filesystemStreaming reads/writes switched to the stream-plus-future shape:
// WASI 0.2 read-via-stream: func(offset: filesize) -> result<input-stream, error-code>; write-via-stream: func(offset: filesize) -> result<output-stream, error-code>; // WASI 0.3 read-via-stream: func(offset: filesize) -> tuple<stream<u8>, future<result<_, error-code>>>; write-via-stream: func(data: stream<u8>, offset: filesize) -> future<result<_, error-code>>;
Directory iteration switched from a resource-based iterator to a stream:
// WASI 0.2 read-directory: func() -> result<directory-entry-stream, error-code>; // plus: resource directory-entry-stream { read-directory-entry: func() -> ... } // WASI 0.3 read-directory: func() -> tuple<stream<directory-entry>, future<result<_, error-code>>>;
wasi:clocksThe
wasi:clockschanges are, deliberately, mostly renames. Flagging them because the churn shows up in downstream suites.WASI#79 (Avoid nonstandard use of names for types) moved the package onto conventional names:
wall-clockbecamesystem-clock, anddatetimebecameinstant. The motivation was consistency with how the rest of the ecosystem talks about clocks. "Wall clock" and "datetime" were WASI-isms that didn't match POSIX, Rust'sstd::time, or most other systems.wasi:filesystemtimestamps followed, for the same reason.A small
types.witwas added to share theduration = u64alias.monotonic-clockalso dropped its pollable-returningsubscribe-instantandsubscribe-durationcalls; callers nowawaita host-provided timer future, the same pattern used everywhere else.Downstream impact is mostly mechanical find-and-replace. See
WebAssembly/wasi-testsuite@f13976f for a representative update across the test suite. -
0.2.026 Sep 2019Nothing published for this version
-
0.1.013 Sep 2019Nothing published for this version