MCPcopy Index your code
hub / github.com/bytecodealliance/wasmtime

github.com/bytecodealliance/wasmtime @v46.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v46.0.1 ↗ · + Follow
32,742 symbols 135,116 edges 2,182 files 9,065 documented · 28%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

wasmtime

<strong>A standalone runtime for
<a href="https://webassembly.org/">WebAssembly</a></strong>

A Bytecode Alliance project

<a href="https://github.com/bytecodealliance/wasmtime/actions?query=workflow%3ACI"><img src="https://github.com/bytecodealliance/wasmtime/workflows/CI/badge.svg" alt="build status" /></a>
<a href="https://bytecodealliance.zulipchat.com/#narrow/stream/217126-wasmtime"><img src="https://img.shields.io/badge/zulip-join_chat-brightgreen.svg" alt="zulip chat" /></a>
<img src="https://img.shields.io/badge/rustc-stable+-green.svg" alt="supported rustc stable" />
<a href="https://docs.rs/wasmtime"><img src="https://docs.rs/wasmtime/badge.svg" alt="Documentation Status" /></a>

Guide | Contributing | Website | Chat

Installation

The Wasmtime CLI can be installed on Linux and macOS (locally) with a small install script:

curl https://wasmtime.dev/install.sh -sSf | bash

This script installs into $WASMTIME_HOME (defaults to $HOME/.wasmtime), and executable is placed in $WASMTIME_HOME/bin.

After running the install script above, follow the on-screen instructions.

Windows or otherwise interested users can download installers and binaries directly from the GitHub Releases page.

For additional installation options, refer to the online book CLI installation page.

Documentation on Wasmtime's currently supported versions can be found in the online book documentation.

Example

If you've got the Rust compiler installed then you can take some Rust source code:

fn main() {
    println!("Hello, world!");
}

and compile it into a WebAssembly component with:

rustup target add wasm32-wasip2
rustc hello.rs --target wasm32-wasip2

Once compiled, you can run your component:

wasmtime hello.wasm

You should see the following output:

Hello, world!

(Note: make sure you installed Rust using the rustup method in the official instructions above, and do not have a copy of the Rust toolchain installed on your system in some other way as well (e.g. the system package manager). Otherwise, the rustup target add... command may not install the target for the correct copy of Rust.)

Features

  • Fast. Wasmtime is built on the optimizing Cranelift code generator to quickly generate high-quality machine code either at runtime or ahead-of-time. Wasmtime is optimized for efficient instantiation, low-overhead calls between the embedder and wasm, and scalability of concurrent instances.

  • Secure. Wasmtime's development is strongly focused on correctness and security. Building on top of Rust's runtime safety guarantees, each Wasmtime feature goes through careful review and consideration via an RFC process. Once features are designed and implemented, they undergo 24/7 fuzzing donated by Google's OSS Fuzz. As features stabilize they become part of a release, and when things go wrong we have a well-defined security policy in place to quickly mitigate and patch any issues. We follow best practices for defense-in-depth and integrate protections and mitigations for issues like Spectre. Finally, we're working to push the state-of-the-art by collaborating with academic researchers to formally verify critical parts of Wasmtime and Cranelift.

  • Configurable. Wasmtime uses sensible defaults, but can also be configured to provide more fine-grained control over things like CPU and memory consumption. Whether you want to run Wasmtime in a tiny environment or on massive servers with many concurrent instances, we've got you covered.

  • WASI. Wasmtime supports a rich set of APIs for interacting with the host environment through the WASI standard.

  • Standards Compliant. Wasmtime passes the official WebAssembly test suite, implements the official C API of wasm, and implements future proposals to WebAssembly as well. Wasmtime developers are intimately engaged with the WebAssembly standards process all along the way too.

Language Support

You can use Wasmtime from a variety of different languages through embeddings of the implementation.

Languages supported by the Bytecode Alliance:

Languages supported by the community:

  • Elixir - the [wasmex hex package]
  • Perl - the [Wasm Perl package's Wasm::Wasmtime]

Documentation

📚 Read the Wasmtime guide here! 📚

The wasmtime guide is the best starting point to learn about what Wasmtime can do for you or help answer your questions about Wasmtime. If you're curious in contributing to Wasmtime, it can also help you do that!


It's Wasmtime.

Extension points exported contracts — how you extend this code

SubTest (Interface)
Common interface for implementations of test commands. Each `.clif` test file may contain multiple test commands, each [13 …
cranelift/filetests/src/subtest.rs
AsReg (Interface)
Describe how to interact with an external register type. [8 implementers]
cranelift/assembler-x64/src/api.rs
ToSExpr (Interface)
Trait for converting ISLE definitions to S-expressions. [25 implementers]
cranelift/isle/isle/src/printer.rs
PrettyPrint (Interface)
Pretty-print part of a disassembly, with knowledge of operand/instruction size, and optionally with regalloc results. Th [31 …
cranelift/codegen/src/machinst/reg.rs
EntityRef (Interface)
A type wrapping a small integer index should implement `EntityRef` so it can be used as the key of an `SecondaryMap` or [6 …
cranelift/entity/src/lib.rs
Encode (Interface)
Helper trait to encode instructions into a "sink". [21 implementers]
pulley/src/encode.rs
TryClone (Interface)
A trait for values that can be cloned, but contain owned, heap-allocated values whose allocations may fail during clonin [36 …
crates/core/src/alloc/try_clone.rs
GuestErrorType (Interface)
A trait for types which are used to report errors. Each type used in the first result position of an interface function [10 …
crates/wiggle/src/guest_type.rs

Core symbols most depended-on inside this repo

Ok
called by 10367
crates/core/src/error/mod.rs
new
called by 9314
crates/wasmtime/src/profiling_agent/vtune.rs
unwrap
called by 3874
crates/c-api/include/wasmtime/error.hh
unwrap
called by 3511
cranelift/entity/src/packed_option.rs
new
called by 3207
cranelift/codegen/meta/src/shared/entities.rs
push
called by 2445
cranelift/codegen/src/ir/memflags.rs
expect
called by 1656
cranelift/entity/src/packed_option.rs
ins
called by 1316
cranelift/codegen/src/cursor.rs

Shape

Method 19,463
Function 8,168
Class 3,576
Enum 963
Interface 572

Languages

Rust95%
C++4%
TypeScript1%
C1%

Modules by API surface

pulley/src/interp.rs610 symbols
winch/codegen/src/visitor.rs511 symbols
crates/cranelift/src/func_environ.rs259 symbols
cranelift/codegen/src/isa/x64/lower/isle.rs209 symbols
cranelift/isle/veri/veri_engine/tests/veri.rs197 symbols
winch/codegen/src/isa/x64/asm.rs187 symbols
crates/wasmtime/src/runtime/component/concurrent.rs187 symbols
tests/all/cli_tests.rs160 symbols
crates/wasmtime/src/runtime/component/concurrent/futures_and_streams.rs158 symbols
crates/wasmtime/src/config.rs155 symbols
crates/environ/src/vmoffsets.rs155 symbols
winch/codegen/src/isa/x64/masm.rs153 symbols

For agents

$ claude mcp add wasmtime \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page