Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 117e163

Browse files
authoredFeb 2, 2022
Simplify main WASI repo (WebAssembly#451)
1 parent db4e3a1 commit 117e163

27 files changed

+301
-973
lines changed
 

‎.github/workflows/main.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

‎.gitignore

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎Contributing.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,61 @@
1-
# Contributing to WebAssembly
1+
# Contributing to WASI
22

33
Interested in participating? Please follow
44
[the same contributing guidelines as the design repository][].
55

66
[the same contributing guidelines as the design repository]: https://github.com/WebAssembly/design/blob/master/Contributing.md
77

88
Also, please be sure to read [the README.md](README.md) for this repository.
9+
10+
## Championing a Proposal
11+
12+
If you want to champion a new proposal, here's what you need to do in each phase:
13+
14+
### Phase 0: Gauge interest
15+
16+
You have an idea for an API. To see whether others are interested in pursuing the idea, you should work up a rough description of the API and post it somewhere that is publicly visible. This could be in the WASI issue queue, or in a gist or as its own repo. You can use the [proposal template] if you like, but it's not required in this phase.
17+
18+
Once you've done this, you can optionally have the subgroup discuss the idea by adding a discussion item to the [WASI meeting agenda].
19+
20+
Once you feel ready, you can add a vote to the [WASI meeting agenda] to move to the next stage.
21+
22+
### Phase 1: Write spec text
23+
24+
At this point, the WASI SG chair will create a new repo for the proposal in the WebAssembly GitHub org. This will follow the conventions of the [proposal template]. If you have any questions about how to fill in the spec template, you can reach out to the WASI SG chair.
25+
26+
As part of moving to the next phase, the champions need to define the acceptance criteria for Phase 4. This is because WASI includes APIs that cover a diversity of different domains and use cases, so the .
27+
28+
Some examples of potential criteria:
29+
30+
- multiple independent production implementations
31+
- implementations on multiple host platforms
32+
- polyfill implementations
33+
- bindings in toolchains and libraries
34+
35+
Note: portability requirements may vary between proposals, as not all features will necessarily make sense in all host environments.
36+
37+
With all this in place, you can add a vote to [WASI meeting agenda] to move to the next stage.
38+
39+
### Phase 2: Work with implementers to prototype and refine the design
40+
41+
At this point, you should be prototyping the API to make sure it works in practice, and you should develop a test suite which can be used by other implementations to validate their spec compliance.
42+
43+
Once the implmentation has stabilized, it's again time to add a vote to [WASI meeting agenda] to move to the next stage.
44+
45+
### Phase 3: Validate the design through multiple implmentations
46+
47+
At this point, you'll need to get more implementers involved. How many implementations you need depends on the Phase 4 acceptance criteria that you set in Phase 2.
48+
49+
You may need to make changes in response to implementer feedback, but we expect the API to be pretty stable by this point. If implementors uncover especially challenging design issues, the proposal may be sent back to Phase 2 for more development.
50+
51+
Once the implementations are in place, you can add the final WASI SG vote to [WASI meeting agenda]. After this, the proposal advances to a vote in the broader WebAssembly CG.
52+
53+
### Phases 4 & 5: Push it over the finish line
54+
55+
The specific process in Phases 4 and 5 will be determined when we have a proposal ready for them.
56+
57+
Note: While we mostly follow the [WebAssembly CG's Phase Process], the requirements around Web VM implementation, formal notation and the reference interpreter don't apply in the context of WASI.
58+
59+
[proposal template]: https://github.com/WebAssembly/wasi-proposal-template
60+
[WASI meeting agenda]: https://github.com/WebAssembly/meetings/tree/main/wasi
61+
[WebAssembly CG's Phase Process]: https://github.com/WebAssembly/meetings/blob/main/process/phases.md

‎Proposals.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# WASI proposals
2+
3+
WASI APIs are developed as proposals. These proposals go through 5 phases of development (following the [WebAssembly CG's Phase Process]).
4+
5+
You can learn more about contributing new proposals (and other ways to contribute) in our [Contributing] guide.
6+
7+
[WebAssembly CG's Phase Process]: https://github.com/WebAssembly/meetings/blob/main/process/phases.md
8+
[Contributing]: https://github.com/WebAssembly/WASI/blob/main/Contributing.md
9+
10+
## Active Proposals
11+
12+
### Phase 5 - The Feature is Standardized (WG)
13+
14+
| Proposal | Champion | Versions |
15+
| ------------------------------------------------------------------------------ | -------------------------------------- | -------- |
16+
17+
### Phase 4 - Standardize the Feature (WG)
18+
19+
| Proposal | Champion | Versions |
20+
| ------------------------------------------------------------------------------ | -------------------------------------- | -------- |
21+
22+
### Phase 3 - Implementation Phase (CG + WG)
23+
24+
| Proposal | Champion | Versions |
25+
| ------------------------------------------------------------------------------ | -------------------------------------- | -------- |
26+
27+
### Phase 2 - Proposed Spec Text Available (CG + WG)
28+
29+
| Proposal | Champion | Versions |
30+
| ------------------------------------------------------------------------------ | -------------------------------------- | -------- |
31+
| [I/O][wasi-io] | Dan Gohman | |
32+
| [Filesystem][wasi-filesystem] | Dan Gohman | |
33+
| ["Classic" Command-Line][wasi-classic-command] (Legacy, to be deprecated in Q4 2022)| Dan Gohman | |
34+
| [Clocks][wasi-clocks] | Dan Gohman | |
35+
| [Random][wasi-random] | Dan Gohman | |
36+
| [Handle Index][wasi-handle-index] | Dan Gohman | |
37+
| [Poll][wasi-poll] | Dan Gohman | |
38+
| [Machine Learning (wasi-nn)][wasi-nn] | Andrew Brown and Mingqiu Sun | |
39+
40+
### Phase 1 - Feature Proposal (CG)
41+
42+
| Proposal | Champion | Versions |
43+
| ------------------------------------------------------------------------------ | -------------------------------------- | -------- |
44+
| [Crypto][wasi-crypto] | Frank Denis and Daiki Ueno | |
45+
| [HTTP][wasi-http] | Piotr Sikora | |
46+
| [Parallel][wasi-parallel] | Andrew Brown | |
47+
48+
### Phase 0 - Pre-Proposal (CG)
49+
50+
**Note:** The pre-proposal phase is simply meant as a way to share ideas. This means that there may be overlap between pre-proposals. It also means that the WASI subgroup has not yet decided that the pre-proposal is in scope for WASI.
51+
52+
| Proposal | Champion | Versions |
53+
| ------------------------------------------------------------------------------ | -------------------------------------- | -------- |
54+
| [singlestore-labs/wasi-data][wasi-data] | Bailey Hayes | |
55+
| [proxy-wasm/spec][wasi-proxy-wasm] (will advance as multiple, smaller proposals) | Piotr Sikora | |
56+
| [badeend/WASI-Networking][wasi-networking] | Dave Bakker |
57+
58+
## Versioning
59+
60+
Once a proposal reaches Phase 3, we expect the champions to start creating releases, following the conventions of semantic versioning (semver). Releases for active proposals are linked in the chart above.
61+
62+
Proposals remain in the 0.x semver range until they reach Phase 5 and are fully standardized. At that point, a 1.0 release should be made available.
63+
64+
For some APIs, it makes sense to add new features after the API itself has reached Phase 5. These feature additions should go through the same standardization process. Once they have reached Phase 5, the minor version number of the release should be incremented.
65+
66+
Some APIs may require backwards-incompatible changes over time. In these cases, we allow proposals to increment the major version number _only if_ the old API can be implmented in terms of the new API. As part of the new version, champions are expected to provide a tool that enables this backwards-compatibility. If that is not possible, then a new API proposal with a new name should be started. The original API can then be deprecated over time if it makes sense to do so.
67+
68+
[WebAssembly CG Phases process]: https://github.com/WebAssembly/meetings/blob/master/process/phases.md
69+
[witx]: https://github.com/WebAssembly/WASI/blob/master/docs/witx.md
70+
[ephemeral/snapshot/old process]: https://github.com/WebAssembly/WASI/blob/master/phases/README.md
71+
72+
[wasi-clocks]: https://github.com/WebAssembly/wasi-clocks
73+
[wasi-classic-command]: https://github.com/WebAssembly/wasi-classic-command
74+
[wasi-crypto]: https://github.com/WebAssembly/wasi-crypto
75+
[wasi-data]: https://github.com/singlestore-labs/wasi-data
76+
[wasi-filesystem]: https://github.com/WebAssembly/wasi-filesystem
77+
[wasi-io]: https://github.com/WebAssembly/wasi-io
78+
[wasi-misc]: https://github.com/WebAssembly/wasi-misc
79+
[wasi-nn]: https://github.com/WebAssembly/wasi-nn
80+
[wasi-proxy-wasm]: https://github.com/proxy-wasm/spec
81+
[wasi-random]: https://github.com/WebAssembly/wasi-random
82+
[wasi-handle-index]: https://github.com/WebAssembly/wasi-handle-index
83+
[wasi-http]: https://github.com/WebAssembly/wasi-http
84+
[wasi-parallel]: https://github.com/WebAssembly/wasi-parallel
85+
[wasi-poll]: https://github.com/WebAssembly/wasi-poll
86+
[wasi-networking]: https://github.com/badeend/WASI-Networking

‎README.md

Lines changed: 156 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,159 @@
44

55
![WASI](WASI.png)
66

7-
This repository is for the WebAssembly System Interface (WASI) Subgroup of the
8-
[WebAssembly Community Group]. It includes:
9-
- [charter]: describes the goals, scope and deliverables of the group
10-
- [docs]: learn more about WASI
11-
- [meetings]: schedules and agendas for video conference and in-person meetings
12-
- [phases]: the current WASI specifications
13-
- [proposals]: the status of each new specification proposal
14-
15-
[charter]: Charter.md
16-
[docs]: docs/README.md
17-
[meetings]: https://github.com/WebAssembly/meetings/tree/master/wasi
18-
[phases]: phases/README.md
19-
[proposals]: docs/Proposals.md
20-
[WebAssembly Community Group]: https://www.w3.org/community/webassembly/
21-
22-
### Contributing
23-
24-
The [issue tracker] is the place to ask questions, make suggestions, and start discussions.
25-
26-
[issue tracker]: https://github.com/WebAssembly/WASI/issues
7+
The WebAssembly System Interface is not a monolithic standard system interface,
8+
but is instead a modular collection of standardized APIs. None of the APIs are
9+
required to be implemented to have a compliant runtime. Instead, host
10+
environments can choose which APIs make sense for their use cases.
11+
12+
---
13+
## Important Note: WASI is in transition
14+
15+
WASI is transitioning away from the `witx` format and its early experimental ABI. We are transitioning to Interface Types using the `wit` format and the canonical ABI.
16+
17+
All new API proposals should use the new format and the new repo structure that is shown in the [proposal template](https://github.com/WebAssembly/wasi-proposal-template).
18+
19+
Some APIs can not yet be supported in the `wit` format. The advancement of these proposals will be unblocked with work that is ongoing:
20+
21+
- Proposals that require async/streams are expected to be unblocked in early Q2 2022
22+
- Proposals that depend on libc are expected to be unblocked by work in `wasi-libc` and elsewhere. Until then, implementers of these APIs should continue to use the snapshots in this repo, which use the `witx` format. We will provide updates on the progress of this work in the bi-weekly meetings.
23+
24+
---
25+
26+
## Find the APIs
27+
28+
Development of each API happens in its own repo, which you can access
29+
from the [proposals list](Proposals.md).
30+
31+
This repo is for general discussion, as well as documenting how we work
32+
and high-level goals.
33+
34+
## Propose a new API
35+
36+
If you would like to create a new proposal, get started with our
37+
[Contributing guide](Contributing.md).
38+
39+
## WASI High Level Goals
40+
41+
(In the spirit of [WebAssembly's High-Level Goals]
42+
(https://github.com/WebAssembly/design/blob/master/HighLevelGoals.md).)
43+
44+
1. Define a set of portable, modular, runtime-independent, and
45+
WebAssembly-native APIs which can be used by WebAssembly code to interact
46+
with the outside world. These APIs preserve essential sandboxed nature of
47+
WebAssembly through a [Capability-based] API design.
48+
2. Specify and implement incrementally. Start with a Minimum Viable Product
49+
(MVP), then adding additional features, prioritized by feedback and
50+
experience.
51+
3. Supplement API designs with documentation and tests, and, when feasible,
52+
reference implementations which can be shared between wasm engines.
53+
4. Make a great platform:
54+
* Work with WebAssembly tool and library authors to help them provide
55+
WASI support for their users.
56+
* When being WebAssembly-native means the platform isn't directly
57+
compatible with existing applications written for other platforms,
58+
design to enable compatibility to be provided by tools and libraries.
59+
* Allow the overall API to evolve over time; to make changes to API
60+
modules that have been standardized, build implementations of them
61+
using libraries on top of new API modules to provide compatibility.
62+
63+
[Capability-based]: https://en.wikipedia.org/wiki/Capability-based_security
64+
65+
## WASI Design Principles
66+
67+
### Capability-based security
68+
69+
WASI is built using capability-based security principles. Access to
70+
external resources is always represented by *handles*, which are special
71+
values that are *unforgeable*, meaning there's no way to coerce an
72+
arbitrary integer or other type of value into a handle. WASI is also
73+
aiming to have no *ambient authorities*, meaning that there should
74+
be no way to request a handle purely by providing a string or other
75+
user-controlled identifier providing the name of a resource. With these
76+
two properties, the only ways to obtain access to resources are to be
77+
explicitly given handles, or to perform operations on handles which
78+
return new handles.
79+
80+
Note that this is a different sense of "capability" than [Linux
81+
capabilities](http://man7.org/linux/man-pages/man7/capabilities.7.html)
82+
or the withdrawn [POSIX
83+
capabilities](https://archive.org/details/posix_1003.1e-990310), which
84+
are per-process rather than per-resource.
85+
86+
The simplest representation of handles are values of [reference
87+
type](https://github.com/WebAssembly/reference-types). References in
88+
wasm are inherently unforgeable, so they can represent handles directly.
89+
90+
Some programming languages operate primarily within linear memory,
91+
such as C, C++, and Rust, and there currently is no easy way for
92+
these languages to use references in normal code. And even if it does
93+
become possible, it's likely that source code will still require
94+
annotations to fully opt into references, so it won't always be
95+
feasible to use. For these languages, references are stored in a
96+
[table](https://webassembly.github.io/spec/core/bikeshed/index.html#tables%E2%91%A0)
97+
called a *c-list*. Integer indices into the table then identify
98+
resources, which can be easily passed around or stored in memory. In
99+
some contexts, these indices are called *file descriptors* since they're
100+
similar to what POSIX uses that term for. There are even some tools,
101+
such as wasm-bindgen, which make this fairly easy. (Internally, tools
102+
and engines don't always use actual WebAssembly tables to do this,
103+
however those are implementation details. Conceptually, they work as if
104+
they had tables.)
105+
106+
Integer indices are themselves forgeable, however a program can only
107+
access handles within the c-list it has access to, so isolation can still
108+
be achieved, even between libraries which internally use integer indices,
109+
by witholding access to each library's c-list to the other libraries.
110+
Instances can be given access to some c-lists and not others, or even
111+
no c-lists at all, so it's still possible to establish isolation between
112+
instances.
113+
114+
Witx-specified APIs use a special `handle` keyword to mark parameters
115+
and return values which are handles. In the short term, these are
116+
lowered to integer indices, with an implied table, so that the APIs
117+
can be easily used from C and similar languages today. Once [interface
118+
types](https://github.com/WebAssembly/interface-types) is
119+
ready, we expect to make use of them to provide APIs which can be used
120+
either from languages using references or from languages using integer
121+
indices, with tables being used and managed automatically.
122+
123+
### Interposition
124+
125+
Interposition in the context of WASI interfaces is the ability for a
126+
Webassembly instance to implement a given WASI interface, and for a
127+
consumer WebAssembly instance to be able to use this implementation
128+
transparently. This can be used to adapt or attenuate the functionality
129+
of a WASI API without changing the code using it.
130+
131+
In WASI, we envision interposition will primarily be configured
132+
through the mechanisms in the module linking' [link-time virtualization
133+
](https://github.com/WebAssembly/module-linking/blob/master/proposals/module-linking/Explainer.md#link-time-virtualization).
134+
Imports are resolved when a module is instantiated, which may happen
135+
during the runtime of a larger logical application, so we can support
136+
interposition of WASI APIs without defining them in terms of explicit
137+
dynamic dispatch mechanisms.
138+
139+
Interposition is sometimes referred to as "virtualization", however we
140+
use "interposition" here because the word "virtualization" has several
141+
related meanings.
142+
143+
### Compatibility
144+
145+
Compatibility with existing applications and libraries, as well as
146+
existing host platforms, is important, but will sometimes be in conflict
147+
with overall API cleanliness, safety, performance, or portability.
148+
Where practical, WASI seeks to keep the WASI API itself free of
149+
compatibility concerns, and provides compatibility through libraries,
150+
such as WASI libc, and tools. This way, applications which don't require
151+
compatibility for compatibility' sake aren't burdened by it.
152+
153+
### Portability
154+
155+
Portability is important to WASI, however the meaning of portability
156+
will be specific to each API.
157+
158+
WASI's modular nature means that engines don't need to implement every
159+
API in WASI, so we don't need to exclude APIs just because some host
160+
environments can't implement them. We prefer APIs which can run across
161+
a wide variety of engines when feasible, but we'll ultimately decide
162+
whether something is "portable enough" on an API-by-API basis.

‎docs/DesignPrinciples.md

Lines changed: 0 additions & 291 deletions
This file was deleted.

‎docs/HighLevelGoals.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

‎docs/Process.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

‎docs/Proposals.md

Lines changed: 0 additions & 72 deletions
This file was deleted.

‎docs/README.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎docs/WASI-overview.md

Lines changed: 0 additions & 147 deletions
This file was deleted.

‎docs/wasi-software-architecture.png

-27.6 KB
Binary file not shown.

‎legacy/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Legacy WASI docs
2+
3+
In the early days of WASI, we developed design ideas around the ABI and imports. These ideas have made their way into the WebAssembly component model, though sometimes in a greatly modified form.
4+
5+
We will continue to keep these documents in the repo through the end of 2023. After that point, we expect all WASI implmentations to be implmented in terms of the new design.
File renamed without changes.
File renamed without changes.

‎proposal-template/README.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎proposals/README.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎snapshots/README.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎snapshots/make-snapshot.sh

Lines changed: 0 additions & 159 deletions
This file was deleted.

‎standard/README.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

‎test/minimal-command.wasm

-36 Bytes
Binary file not shown.

‎test/sources/generate-wasm.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎test/sources/wat/minimal-command.wat

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎tools/test-harness/exit_status_zero

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎tools/test-harness/run.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

‎tools/test-harness/testcase.sh

Lines changed: 0 additions & 90 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)
Please sign in to comment.