About this project
Wasmtime is a standalone runtime for WebAssembly, developed as a Bytecode Alliance project. It is designed to be fast, secure, configurable and standards-compliant, and it can be used both as a command-line tool and as an embedded runtime in other applications.
Installation
The CLI can be installed on Linux and macOS with a shell script that installs into $WASMTIME_HOME (defaulting to $HOME/.wasmtime), placing the executable in $WASMTIME_HOME/bin. Windows users and others can download installers and binaries from the GitHub Releases page. Additional installation options are documented in the online book.
Example usage
With the Rust compiler installed, a Rust program can be compiled to a WebAssembly component using the wasm32-wasip2 target, and then executed with the wasmtime command. The README shows a hello-world example that prints "Hello, world!" when run.
Key features
- Fast: built on the optimizing Cranelift code generator, which can produce machine code either at runtime or ahead-of-time. It is optimized for efficient instantiation, low-overhead calls between the embedder and wasm, and scalability of concurrent instances.
- Secure: development emphasizes correctness and security, building on Rust's runtime safety guarantees. Features go through an RFC process, continuous fuzzing via Google's OSS Fuzz, a release policy and a defined security policy. The project also integrates defenses against issues such as Spectre and collaborates with academic researchers on formal verification of critical parts of Wasmtime and Cranelift.
- Configurable: sensible defaults are provided, but configuration allows fine-grained control over CPU and memory consumption, from tiny environments to large servers with many concurrent instances.
- WASI: supports a rich set of APIs for interacting with the host environment through the WASI standard.
- Standards compliant: passes the official WebAssembly test suite, implements the official C API of wasm, and implements future WebAssembly proposals. Developers are engaged with the WebAssembly standards process.
Language support
Wasmtime can be embedded from multiple languages. Languages supported by the Bytecode Alliance include Rust (the wasmtime crate), C (wasm.h, wasi.h and wasmtime.h headers, with CMake), C++ (wasmtime.hh header), Python (the wasmtime PyPI package), .NET (the Wasmtime NuGet package), Go (the wasmtime-go repository) and Ruby (the wasmtime gem). Community-supported languages include Elixir (the wasmex hex package) and Perl (the Wasm::Wasmtime module in the Wasm Perl package).
Documentation
The Wasmtime guide is the recommended starting point for learning what Wasmtime can do, answering questions, and contributing to the project.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.