This commit adds the skeleton of a new set of documentation for `wasmtime` in the existing `docs` directory. This documentation is organized and compiled with [mdbook] which the Rust project uses for most of its own documentation as well. At a previous meeting we brainstormed a rough skeleton of what the documentation in this book would look like, and I've transcribed that here for an example of how this is rendered and how it can be laid out. No actual documentation is written yet. This commit also additionally adds necessary support to auto-publish both this book documentation and API documentation every time a commit is pushed to the `master` branch. All HTML will be automatically pushed to the `gh-pages` branch so long as the CI passes, and this should get deployed to https://cranestation.github.io/wasmtime. I've done a few dry-runs and I think this'll all work, but we'll likely tweak a few things here and there after running this through CI to make sure everything looks just as we'd like. My hope though is that after this lands we can start actually filling out all the documentation and being able to review it as well. [mdbook]: https://crates.io/crates/mdbook
Wasmtime: a WebAssembly Runtime.
Wasmtime is a standalone wasm-only optimizing runtime for WebAssembly and WASI. It runs WebAssembly code outside of the Web, and can be used both as a command-line utility or as a library embedded in a larger application.
To get started, visit wasmtime.dev.
There are Rust, C, and C++ toolchains that can compile programs with WASI. See the WASI intro for more information, and the WASI tutorial for a tutorial on compiling and running programs using WASI and wasmtime, as well as an overview of the filesystem sandboxing system.
Wasmtime passes the WebAssembly spec testsuite. To run it, update the
spec_testsuite submodule with git submodule update --remote, and it will
be run as part of cargo test.
Wasmtime does not yet implement Spectre mitigations, however this is a subject of ongoing research.
Additional goals for Wasmtime include:
- Support a variety of host APIs (not just WASI), with fast calling sequences, and develop proposals for additional API modules to be part of WASI.
- Implement the proposed WebAssembly C API.
- Facilitate testing, experimentation, and development around the Cranelift and Lightbeam JITs.
- Develop a native ABI used for compiling WebAssembly suitable for use in both JIT and AOT to native object files.
Including Wasmtime in your project
Wasmtime exposes an API for JIT compilation through the wasmtime-jit subcrate, which depends on wasmtime-environ and wasmtime-runtime for the ABI and runtime support respectively. However, this API is not documented and subject to change. Please use at your own risk!
Build the individual crates as such:
cargo build --package wasmtime-jit
Wasmtime does not currently publish these crates on crates.io. They may be included as a git dependency, like this:
[dependencies]
wasmtime-environ = { git = "https://github.com/CraneStation/wasmtime", rev = "somecommithash" }
wasmtime-runtime = { git = "https://github.com/CraneStation/wasmtime", rev = "somecommithash" }
wasmtime-jit = { git = "https://github.com/CraneStation/wasmtime", rev = "somecommithash" }
All three crates must be specified as dependencies for wasmtime-jit to build correctly, at the moment.
It's Wasmtime.