xref: /wasmtime-44.0.1/docs/WASI-intro.md (revision 2e27ff4e)
1# Welcome to WASI!
2
3WASI stands for WebAssembly System Interface. It's an API designed by
4the [Wasmtime] project that provides access to several operating-system-like
5features, including files and filesystems, Berkeley sockets, clocks, and
6random numbers, that we'll be proposing for standardization.
7
8It's designed to be independent of browsers, so it doesn't depend on
9Web APIs or JS, and isn't limited by the need to be compatible with JS.
10And it has integrated capability-based security, so it extends
11WebAssembly's characteristic sandboxing to include I/O.
12
13See the [WASI Overview](WASI-overview.md) for more detailed background
14information, and the [WASI Tutorial](WASI-tutorial.md) for a walkthrough
15showing how various pieces fit together.
16
17Note that everything here is a prototype, and while a lot of stuff works,
18there are numerous missing features and some rough edges. For example,
19networking support is incomplete.
20
21## How can I write programs that use WASI?
22
23The two toolchains that currently work well are the Rust toolchain and
24a specially packaged C and C++ toolchain. Of course, we hope other
25toolchains will be able to implement WASI as well!
26
27### Rust
28
29To install a WASI-enabled Rust toolchain, see the [online section of the
30guide](https://bytecodealliance.github.io/wasmtime/wasm-rust.html)
31
32### C/C++
33
34To install a WASI-enabled C/C++ toolchain, see the [online section of the
35guide](https://bytecodealliance.github.io/wasmtime/wasm-c.html)
36
37## How can I run programs that use WASI?
38
39Currently the options are [Wasmtime] and the [browser polyfill], though we
40intend WASI to be implementable in many wasm VMs.
41
42[Wasmtime]: https://github.com/bytecodealliance/wasmtime
43[browser polyfill]: https://github.com/bjorn3/browser_wasi_shim
44
45### Wasmtime
46
47[Wasmtime] is a non-Web WebAssembly engine which is part of the
48[Bytecode Alliance project](https://bytecodealliance.org). To build
49it, download the code and build with `cargo build --release`. It can
50run WASI-using wasm programs by simply running `wasmtime foo.wasm`,
51or `cargo run --bin wasmtime foo.wasm`.
52
53### The browser polyfill
54
55The source is [here](https://github.com/bjorn3/browser_wasi_shim).
56
57## Where can I learn more?
58
59Beyond the [WASI Overview](WASI-overview.md), take a look at the
60various [WASI documents](WASI-documents.md).
61