Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Contributing.md → CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Interested in participating? Please follow

Also, please be sure to read [the README.md](README.md) for this repository.

To contribute to an [existing proposal](https://github.com/WebAssembly/WASI/blob/main/Proposals.md),
To contribute to an [existing proposal](https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md),
refer to the linked proposal repository.

The start a new proposal, the first step is to file an issue in the
Expand Down Expand Up @@ -46,7 +46,7 @@ During this phase:

1. An issue is filed on the [WASI repository](https://github.com/WebAssembly/WASI/issues) to present the idea.
1. Discussion on the API occurs on the issue.
1. A champion or champions emerge. They may add the proposal to the [proposal list](https://github.com/WebAssembly/WASI/blob/main/Proposals.md) at phase 0.
1. A champion or champions emerge. They may add the proposal to the [proposal list](https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md) at phase 0.
1. The champion(s) put together a description of the API in their own GitHub repository or on the issue. You can use the [proposal template] if you like, but it's not required in this phase.

### 1. Feature Proposal [WASI Subgroup]
Expand All @@ -58,7 +58,7 @@ Entry requirements:

During this phase:

1. If the proposal is not already listed, it should be added to the [proposal list](https://github.com/WebAssembly/WASI/blob/main/Proposals.md) at this time.
1. If the proposal is not already listed, it should be added to the [proposal list](https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md) at this time.
1. A new repository, forking the [proposal template] repo, is created by one of the SG chairs, or transferred to the WebAssembly organization by the champion.
1. The champion will attempt to reach broad consensus in the Subgroup.
1. Pull requests and issues are used to iterate on the design of the API. Specifically, an overview document must be produced that specifies the API with reasonably precise and complete language before attempting to move to phase 2 (meaning it is sufficiently precise to be implemented following this description, without obvious holes or ambiguities).
Expand Down
108 changes: 2 additions & 106 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,120 +25,16 @@ virtualizability, and more.
## Find the APIs

Development of each API happens in its own repo, which you can access
from the [proposals list](Proposals.md).
from the [proposals list](docs/Proposals.md).

This repo is for general discussion, as well as documenting how we work
and high-level goals.

## Propose a new API

If you would like to create a new proposal, get started with our
[Contributing guide](Contributing.md).
[Contributing guide](CONTRIBUTING.md).

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).

See the [Wit in WASI](docs/WitInWasi.md) document for more information about using Wit for WASI proposals.

## WASI High Level Goals

(In the spirit of [WebAssembly's High-Level Goals](https://github.com/WebAssembly/design/blob/main/HighLevelGoals.md).)

1. Define a set of portable, modular, runtime-independent, and
WebAssembly-native APIs which can be used by WebAssembly code to interact
with the outside world. These APIs preserve the essential sandboxed nature of
WebAssembly through a [Capability-based] API design.
2. Specify and implement incrementally. Start with a Minimum Viable Product
(MVP), then adding additional features, prioritized by feedback and
experience.
3. Supplement API designs with documentation and tests, and, when feasible,
reference implementations which can be shared between wasm engines.
4. Make a great platform:
* Work with WebAssembly tool and library authors to help them provide
WASI support for their users.
* When being WebAssembly-native means the platform isn't directly
compatible with existing applications written for other platforms,
design to enable compatibility to be provided by tools and libraries.
* Allow the overall API to evolve over time; to make changes to API
modules that have been standardized, build implementations of them
using libraries on top of new API modules to provide compatibility.

[Capability-based]: https://en.wikipedia.org/wiki/Capability-based_security

## WASI Design Principles

### Capability-based security

WASI is designed with capability-based security principles, using the
facilities provided by the Wasm [component model]. All access to external
resources is provided by capabilities.

There are two kinds of capabilities:

- Handles, defined in the [component-model type system], dynamically
identify and provide access to resources. They are unforgeable, meaning
there's no way for an instance to acquire access to a handle other than
to have another instance explicitly pass one to it.

- Link-time capabilities, which are functions which require no handle
arguments, are used sparingly, in situations where it's not necessary
to identify more than one instance of a resource at runtime. Link-time
capabilities are *interposable*, so they are still refusable in a
capability-based security sense.

WASI has no *ambient authorities*, meaning that there are no global
namespaces at runtime, and no global functions at link time.

[component model]: https://github.com/WebAssembly/component-model
[component-model type system]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/Explainer.md#type-definitions

Note that this is a different sense of "capability" than [Linux
capabilities](http://man7.org/linux/man-pages/man7/capabilities.7.html)
or the withdrawn [POSIX
capabilities](https://archive.org/details/posix_1003.1e-990310), which
are per-process rather than per-resource.

### Interposition

Interposition in the context of WASI interfaces is the ability for a
Webassembly instance to implement a given WASI interface, and for a
consumer WebAssembly instance to be able to use this implementation
transparently. This can be used to adapt or attenuate the functionality
of a WASI API without changing the code using it.

Component model interfaces always support link-time interposition. While
WASI APIs are often implemented in hosts, they can also be implemented
in Wasm, which may itself be a wrapper around the host. This may be used
to implement *attenuation*, providing filtered access to the underlying
host-provided functionality.

Interposition is sometimes referred to as "virtualization", however we
use "interposition" here because the word "virtualization" has several
related meanings.

### Compatibility

Compatibility with existing applications and libraries, as well as
existing host platforms, is important, but will sometimes be in conflict
with overall API cleanliness, safety, performance, or portability.
Where practical, WASI seeks to keep the WASI API itself free of
compatibility concerns, and provides compatibility through libraries,
such as WASI libc, and tools. This way, applications which don't require
compatibility for compatibility's sake aren't burdened by it.

### Portability

Portability is important to WASI, however the meaning of portability
will be specific to each API.

WASI's modular nature means that engines don't need to implement every
API in WASI, so we don't need to exclude APIs just because some host
environments can't implement them. We prefer APIs which can run across
a wide variety of engines when feasible, but we'll ultimately decide
whether something is "portable enough" on an API-by-API basis.

### Modularity

WASI will include many interfaces that are not appropriate for every host
environment, so WASI uses the component model's worlds mechanism to allow
specific sets of APIs to be described which meet the needs of different
environments.
File renamed without changes.
78 changes: 78 additions & 0 deletions docs/DesignPrinciples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
## WASI Design Principles

### Capability-based security

WASI is designed with capability-based security principles, using the
facilities provided by the Wasm [component model]. All access to external
resources is provided by capabilities.

There are two kinds of capabilities:

- Handles, defined in the [component-model type system], dynamically
identify and provide access to resources. They are unforgeable, meaning
there's no way for an instance to acquire access to a handle other than
to have another instance explicitly pass one to it.

- Link-time capabilities, which are functions which require no handle
arguments, are used sparingly, in situations where it's not necessary
to identify more than one instance of a resource at runtime. Link-time
capabilities are *interposable*, so they are still refusable in a
capability-based security sense.

WASI has no *ambient authorities*, meaning that there are no global
namespaces at runtime, and no global functions at link time.

[component model]: https://github.com/WebAssembly/component-model
[component-model type system]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/Explainer.md#type-definitions

Note that this is a different sense of "capability" than [Linux
capabilities](http://man7.org/linux/man-pages/man7/capabilities.7.html)
or the withdrawn [POSIX
capabilities](https://archive.org/details/posix_1003.1e-990310), which
are per-process rather than per-resource.

### Interposition

Interposition in the context of WASI interfaces is the ability for a
Webassembly instance to implement a given WASI interface, and for a
consumer WebAssembly instance to be able to use this implementation
transparently. This can be used to adapt or attenuate the functionality
of a WASI API without changing the code using it.

Component model interfaces always support link-time interposition. While
WASI APIs are often implemented in hosts, they can also be implemented
in Wasm, which may itself be a wrapper around the host. This may be used
to implement *attenuation*, providing filtered access to the underlying
host-provided functionality.

Interposition is sometimes referred to as "virtualization", however we
use "interposition" here because the word "virtualization" has several
related meanings.

### Compatibility

Compatibility with existing applications and libraries, as well as
existing host platforms, is important, but will sometimes be in conflict
with overall API cleanliness, safety, performance, or portability.
Where practical, WASI seeks to keep the WASI API itself free of
compatibility concerns, and provides compatibility through libraries,
such as WASI libc, and tools. This way, applications which don't require
compatibility for compatibility's sake aren't burdened by it.

### Portability

Portability is important to WASI, however the meaning of portability
will be specific to each API.

WASI's modular nature means that engines don't need to implement every
API in WASI, so we don't need to exclude APIs just because some host
environments can't implement them. We prefer APIs which can run across
a wide variety of engines when feasible, but we'll ultimately decide
whether something is "portable enough" on an API-by-API basis.

### Modularity

WASI will include many interfaces that are not appropriate for every host
environment, so WASI uses the component model's worlds mechanism to allow
specific sets of APIs to be described which meet the needs of different
environments.
24 changes: 24 additions & 0 deletions docs/HighLevelGoals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## WASI High Level Goals

(In the spirit of [WebAssembly's High-Level Goals](https://github.com/WebAssembly/design/blob/main/HighLevelGoals.md).)

1. Define a set of portable, modular, runtime-independent, and
WebAssembly-native APIs which can be used by WebAssembly code to interact
with the outside world. These APIs preserve the essential sandboxed nature of
WebAssembly through a [Capability-based] API design.
2. Specify and implement incrementally. Start with a Minimum Viable Product
(MVP), then adding additional features, prioritized by feedback and
experience.
3. Supplement API designs with documentation and tests, and, when feasible,
reference implementations which can be shared between wasm engines.
4. Make a great platform:
* Work with WebAssembly tool and library authors to help them provide
WASI support for their users.
* When being WebAssembly-native means the platform isn't directly
compatible with existing applications written for other platforms,
design to enable compatibility to be provided by tools and libraries.
* Allow the overall API to evolve over time; to make changes to API
modules that have been standardized, build implementations of them
using libraries on top of new API modules to provide compatibility.

[Capability-based]: https://en.wikipedia.org/wiki/Capability-based_security
4 changes: 2 additions & 2 deletions proposals/README.md → docs/Preview2.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Preview 2 in terms of Preview 3.
The release criteria of Preview 3 will include that performance will be measured
and addressed.

[WASI Subgroup Phase Process]: https://github.com/WebAssembly/WASI/blob/main/Contributing.md#the-phase-process
[portability criteria]: https://github.com/WebAssembly/WASI/blob/main/Contributing.md#2-feature-description-available-wasi-subgroup
[WASI Subgroup Phase Process]: https://github.com/WebAssembly/WASI/blob/main/CONTRIBUTING.md#the-phase-process
[portability criteria]: https://github.com/WebAssembly/WASI/blob/main/CONTRIBUTING.md#2-feature-description-available-wasi-subgroup
[worlds]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md#wit-worlds
[launch criteria]: #wasi-preview-2-launch-criteria
4 changes: 2 additions & 2 deletions Proposals.md → docs/Proposals.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ WASI APIs are developed as proposals. These proposals go through 5 phases of dev

You can learn more about contributing new proposals (and other ways to contribute) in our [Contributing] guide.

[the WASI Subgroup's Phase Process]: https://github.com/WebAssembly/WASI/blob/main/Contributing.md#the-phase-process
[Contributing]: https://github.com/WebAssembly/WASI/blob/main/Contributing.md
[the WASI Subgroup's Phase Process]: https://github.com/WebAssembly/WASI/blob/main/CONTRIBUTING.md#the-phase-process
[Contributing]: https://github.com/WebAssembly/WASI/blob/main/CONTRIBUTING.md

## Active Proposals

Expand Down
2 changes: 1 addition & 1 deletion proposals/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) A

wasi-cli is currently in [Phase 3].

[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/Proposals.md#phase-3---implementation-phase-cg--wg
[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md#phase-3---implementation-phase-cg--wg

### Champions

Expand Down
2 changes: 1 addition & 1 deletion proposals/clocks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) A

WASI-clocks is currently in [Phase 3].

[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/Proposals.md#phase-3---implementation-phase-cg--wg
[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md#phase-3---implementation-phase-cg--wg

### Champions

Expand Down
2 changes: 1 addition & 1 deletion proposals/filesystem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) A

WASI-filesystem is currently in [Phase 3].

[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/Proposals.md#phase-3---implementation-phase-cg--wg
[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md#phase-3---implementation-phase-cg--wg

### Champions

Expand Down
2 changes: 1 addition & 1 deletion proposals/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) A

### Current Phase

wasi-http is currently in [Phase 3](https://github.com/WebAssembly/WASI/blob/main/Proposals.md#phase-3---implementation-phase-cg--wg)
wasi-http is currently in [Phase 3](https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md#phase-3---implementation-phase-cg--wg)

### Champions

Expand Down
2 changes: 1 addition & 1 deletion proposals/io/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) A

WASI I/O is currently in [Phase 3].

[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/Proposals.md#phase-3---implementation-phase-cg--wg
[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md#phase-3---implementation-phase-cg--wg

### Champions

Expand Down
2 changes: 1 addition & 1 deletion proposals/random/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) A

WASI-random is currently in [Phase 3].

[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/Proposals.md#phase-3---implementation-phase-cg--wg
[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md#phase-3---implementation-phase-cg--wg

### Champions

Expand Down
2 changes: 1 addition & 1 deletion proposals/sockets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) A

### Current Phase

[Phase 3](https://github.com/WebAssembly/WASI/blob/main/Proposals.md#phase-3---implementation-phase-cg--wg)
[Phase 3](https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md#phase-3---implementation-phase-cg--wg)

### Champions

Expand Down