Even though this somehow passed on Travis on [the PR](https://github.com/CraneStation/wasmtime/pull/209), it fails on Travis on master, and I can reproduce the failure. The failure is on spec_testsuite/names.wast: ``` $ RUST_BACKTRACE=1 target/debug/wast spec_testsuite/names.wast thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: FromUtf8Error { bytes: [255], error: Utf8Error { valid_up_to: 0, error_len: Some(1) } }', src/libcore/result.rs:999:5 stack backtrace: [...] 9: core::result::Result<T,E>::unwrap at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libcore/result.rs:800 10: wabt::script::jstring_to_rstring at [...]/.cargo/registry/src/github.com-1ecc6299db9ec823/wabt-0.8.0/src/script/mod.rs:261 11: wabt::script::parse_action at [...]/.cargo/registry/src/github.com-1ecc6299db9ec823/wabt-0.8.0/src/script/mod.rs:274 12: wabt::script::ScriptParser<F32,F64>::next at [...]/.cargo/registry/src/github.com-1ecc6299db9ec823/wabt-0.8.0/src/script/mod.rs:504 13: wasmtime_wast::wast::WastContext::run_buffer at wasmtime-wast/src/wast.rs:202 14: wasmtime_wast::wast::WastContext::run_file at wasmtime-wast/src/wast.rs:472 15: wast::main at src/wast.rs:107 [...] ```
Wasmtime: a WebAssembly Runtime.
Wasmtime is a standalone wasm-only runtime for WebAssembly, using the Cranelift JIT.
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.
Wasmtime passes the WebAssembly spec testsuite, and supports a new system API proposal called WebAssembly System Interface, or WASI.
Wasmtime includes a git submodule; in order to build it, it's necessary to obtain a full checkout, like this:
git clone --recurse-submodules https://github.com/CraneStation/wasmtime.git
To build Wasmtime, install cmake and clang, and then build with cargo, such as with "cargo build --release". For information on installing clang, see rust-bindgen's documentation.
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 does not yet implement Spectre mitigations, such as those being pioneered by wasmjit, however this is a subject of ongoing research.
Additional goals for Wasmtime include:
- Support a variety of host APIs (not just WASI Core), with fast calling sequences, and develop proposals for additional API modules to be part of WASI. Reference Sysroot.
- 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.