• Stars
    star
    4,510
  • Rank 8,978 (Top 0.2 %)
  • Language
    Rust
  • License
    Other
  • Created about 5 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

WebAssembly System Interface

DOI

WebAssembly System Interface

WASI

The WebAssembly System Interface is not a monolithic standard system interface, but is instead a modular collection of standardized APIs. None of the APIs are required to be implemented to have a compliant runtime. Instead, host environments can choose which APIs make sense for their use cases.


Important Note: WASI is in transition

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.

All new API proposals should use the new format and the new repo structure that is shown in the proposal template.

See the Wit in WASI document for more information about using Wit for WASI proposals.


Find the APIs

Development of each API happens in its own repo, which you can access from the proposals list.

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.

WASI High Level Goals

(In the spirit of WebAssembly's High-Level Goals.)

  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.

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.

Note that this is a different sense of "capability" than Linux capabilities or the withdrawn POSIX capabilities, 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.

More Repositories

1

design

WebAssembly Design Documents
11,261
star
2

binaryen

Optimizer and compiler/toolchain library for WebAssembly
WebAssembly
7,048
star
3

wabt

The WebAssembly Binary Toolkit
C++
6,350
star
4

spec

WebAssembly specification, reference interpreter, and test suite.
WebAssembly
3,061
star
5

wasi-sdk

WASI-enabled WebAssembly C/C++ toolchain
Shell
1,097
star
6

gc

Branch of the spec repo scoped to discussion of GC integration in WebAssembly
WebAssembly
911
star
7

proposals

Tracking WebAssembly proposals
849
star
8

component-model

Repository for design and specification of the Component Model
Python
827
star
9

wasi-libc

WASI libc implementation for WebAssembly
C
784
star
10

interface-types

WebAssembly
640
star
11

threads

Threads and Atomics in WebAssembly
WebAssembly
577
star
12

wasm-c-api

Wasm C API prototype
C++
521
star
13

simd

Branch of the spec repo scoped to discussion of SIMD in WebAssembly
WebAssembly
519
star
14

meetings

WebAssembly meetings (VC or in-person), agendas, and notes
HTML
438
star
15

wasi-nn

Neural Network proposal for WASI
380
star
16

esm-integration

ECMAScript module integration
WebAssembly
341
star
17

wasm-jit-prototype

Standalone VM using LLVM JIT
C++
307
star
18

tool-conventions

Conventions supporting interoperatibility between tools working with WebAssembly.
276
star
19

website

WebAssembly website
CSS
269
star
20

testsuite

Mirror of the spec testsuite
WebAssembly
172
star
21

memory64

Memory with 64-bit indexes
WebAssembly
168
star
22

reference-types

Proposal for adding basic reference types (anyref)
WebAssembly
161
star
23

wasi-crypto

WASI Cryptography API Proposal
Makefile
160
star
24

wasi-sockets

WASI API proposal for managing sockets
Rust
155
star
25

exception-handling

Proposal to add exception handling to WebAssembly
WebAssembly
141
star
26

wasi-filesystem

Filesystem API for WASI
140
star
27

module-linking

Proposal for allowing modules to define, import and export modules and instances
WebAssembly
119
star
28

multi-memory

Multiple per-module memories for Wasm
WebAssembly
115
star
29

wasi-threads

WebAssembly
111
star
30

wasi-http

108
star
31

tail-call

Proposal to add tail calls to WebAssembly
WebAssembly
106
star
32

wasp

WebAssembly module decoder in C++
C++
105
star
33

stack-switching

A repository for the stack switching proposal.
WebAssembly
105
star
34

debugging

Design documents and discussions about debug support in WebAssembly
98
star
35

wasi-io

I/O Types proposal for WASI
96
star
36

wasmint

Library for interpreting / debugging wasm code
C++
93
star
37

function-references

Proposal for Typed Function References
WebAssembly
91
star
38

bulk-memory-operations

Bulk memory operations
WebAssembly
74
star
39

multi-value

Proposal to add multi-values to WebAssembly
WebAssembly
66
star
40

wasi-testsuite

WASI Testsuite
Rust
45
star
41

waterfall

Build and test bots
44
star
42

flexible-vectors

Vector operations for WebAssembly
WebAssembly
42
star
43

js-types

Proposal for adding type reflection to the JS API
WebAssembly
42
star
44

content-security-policy

WebAssembly
39
star
45

wasi-cloud-core

Rust
39
star
46

js-promise-integration

JavaScript Promise Integration
WebAssembly
37
star
47

relaxed-simd

Relax the strict determinism requirements of SIMD operations.
WebAssembly
36
star
48

wasi-webgpu

36
star
49

JS-BigInt-integration

JavaScript BigInt to WebAssembly i64 integration
WebAssembly
36
star
50

wasi-libc-old

Precursor to WASI libc.
C
35
star
51

stringref

WebAssembly
34
star
52

benchmarks

Resources for collaborative benchmarking
JavaScript
27
star
53

wasi-random

Entropy source API for WASI
25
star
54

wasi-keyvalue

24
star
55

wasi-clocks

Clocks API for WASI
22
star
56

wasi-sql

20
star
57

annotations

Proposal for Custom Annotation Syntax in the Text Format
WebAssembly
19
star
58

proposal-type-imports

Proposal for Type Imports & Exports
WebAssembly
19
star
59

memory-control

A proposal to introduce finer grained control of WebAssembly memory.
WebAssembly
19
star
60

shared-everything-threads

A draft proposal for spawning threads in WebAssembly
WebAssembly
18
star
61

constant-time

Constant-time WebAssembly
WebAssembly
18
star
62

wasi-sql-embed

18
star
63

wasi-proposal-template

Starter template for proposing a new WASI API
17
star
64

wasi-parallel

wasi-parallel is a proposal to add a parallel for construct to WASI.
Shell
17
star
65

sign-extension-ops

Sign-extension opcodes
WebAssembly
17
star
66

funclets

Proposal for adding funclets - flexible intraprocedural control flow
WebAssembly
17
star
67

mutable-global

Import & export of mutable globals
WebAssembly
16
star
68

wasi-tools

WASI tools
Rust
16
star
69

wasi-poll

16
star
70

wasi-messaging

messaging proposal for WASI
15
star
71

wasi-cli

Command-Line Interface (CLI) World for WASI
15
star
72

instrument-tracing

Proposal to add instrumentation and tracing instructions to WebAssembly
WebAssembly
14
star
73

nontrapping-float-to-int-conversions

Proposal to add non-trapping float-to-int conversions to WebAssembly
WebAssembly
14
star
74

extended-const

Proposal for extended constant expressions
WebAssembly
14
star
75

conditional-sections

WebAssembly
13
star
76

wasi-grpc

13
star
77

profiles

Profiles proposal
WebAssembly
12
star
78

wasi-logging

WASI logging API
11
star
79

extended-name-section

WebAssembly
11
star
80

feature-detection

WebAssembly
10
star
81

webassembly.github.io

Redirect to webassembly.org
HTML
10
star
82

wasi-blobstore

10
star
83

wasi-runtime-config

9
star
84

testsuite-js

WebAssembly testsuite tests converted to single-file JavaScript tests
JavaScript
9
star
85

lld

Staging repository for upstreaming WebAssembly support into lld
C++
9
star
86

branch-hinting

Proposal to add branch hinting functionality to WebAssembly
WebAssembly
9
star
87

decompressor-prototype

C++
8
star
88

wasi-observe

Observability World for WASI
Just
8
star
89

wat-numeric-values

Proposal to add numeric values to data segment definitions in the text format
WebAssembly
7
star
90

gc-js-customization

WebAssembly
7
star
91

wasi-classic-command

6
star
92

wasi-url

6
star
93

wasi-i2c

I2C API for WASi
Rust
5
star
94

wg-charter

Proposed WebAssembly Working Group charter
HTML
5
star
95

wit-abi-up-to-date

4
star
96

call-tags

WebAssembly
4
star
97

cg-charter

Proposed WebAssembly Community Group charter
HTML
4
star
98

root-scanning

Spec proposal for scanning/marking of linear memory GC roots
WebAssembly
4
star
99

js-string-builtins

JS String Builtins
WebAssembly
3
star
100

conditional-segment-initialization

Conditional segment initialization
WebAssembly
3
star