Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsJul 3, 2026·3 min de lecture

wazero — Zero-Dependency WebAssembly Runtime for Go

A WebAssembly runtime written in pure Go with zero dependencies. Embed Wasm modules in Go applications without CGo, system libraries, or JIT compilation.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
wazero
Commande d'installation directe
npx -y tokrepo@latest install 3be66130-771e-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

wazero is a WebAssembly runtime for Go developers that has zero platform dependencies. It compiles to pure Go with no CGo bindings, making it easy to cross-compile and deploy anywhere Go runs. It supports both an interpreter and an ahead-of-time compiler for balancing portability with performance.

What wazero Does

  • Runs WebAssembly modules inside Go applications without external dependencies
  • Supports WASI preview 1 for filesystem, environment, and I/O operations
  • Provides both interpreter and ahead-of-time (AOT) compilation modes
  • Implements the WebAssembly 2.0 core specification
  • Embeds as a Go library with a clean, idiomatic API

Architecture Overview

wazero implements two execution engines: an interpreter for maximum portability and an AOT compiler that translates Wasm bytecode to native machine code at load time. Both engines share the same module instantiation and memory management code. The runtime manages linear memory, tables, and globals per the Wasm spec. Host functions can be registered to expose Go functionality to Wasm modules.

Self-Hosting & Configuration

  • Add wazero as a Go module dependency with go get
  • Instantiate a runtime, compile a Wasm module, and call exported functions
  • Choose between interpreter mode (maximum compatibility) and compiler mode (faster execution)
  • Register host functions to expose Go APIs to Wasm guest code
  • Configure memory limits, WASI options, and filesystem access through the API

Key Features

  • Pure Go with zero CGo or system library dependencies
  • Cross-compiles to every platform Go supports without build toolchain changes
  • Two execution modes: interpreter for portability, AOT compiler for performance
  • Full WASI preview 1 support with configurable filesystem and environment
  • Compliant with the WebAssembly 2.0 core specification

Comparison with Similar Tools

  • Wasmtime — Rust/C-based JIT runtime vs. pure Go with no native dependencies
  • wasm3 — C-based universal interpreter vs. Go-native with AOT compilation option
  • WasmEdge — C++-based cloud runtime vs. embeddable Go library
  • Extism — plugin framework on top of runtimes vs. raw runtime you build plugins with

FAQ

Q: Why choose wazero over Wasmtime with Go bindings? A: wazero has no CGo dependency, which simplifies cross-compilation, reduces binary size, and avoids CGo-related build complexity.

Q: How fast is the AOT compiler compared to the interpreter? A: The AOT compiler is typically 10-50x faster than the interpreter for compute-intensive workloads, with compilation adding a one-time startup cost.

Q: Can I use wazero for plugin systems? A: Yes. Many Go projects use wazero to run untrusted Wasm plugins in a sandboxed environment with controlled host function access.

Q: Does it support the component model? A: wazero currently supports the core WebAssembly specification. Component model support is being tracked but not yet implemented.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires