Scripts2026年7月18日·1 分钟阅读

WABT — The WebAssembly Binary Toolkit

A suite of command-line tools for working with WebAssembly binary and text formats.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
WABT Overview
直接安装命令
npx -y tokrepo@latest install 98ea2f57-82a5-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

WABT (pronounced "wabbit") is the official WebAssembly Binary Toolkit maintained by the WebAssembly community group. It provides a set of command-line tools for converting between the WebAssembly text format (WAT) and binary format (WASM), validating modules, inspecting binaries, and running simple interpreters.

What WABT Does

  • Converts WebAssembly text format to binary (wat2wasm) and back (wasm2wat)
  • Validates WebAssembly modules for spec compliance (wasm-validate)
  • Disassembles and dumps WASM binaries for inspection (wasm-objdump)
  • Decompiles WASM to a C-like pseudo-code (wasm-decompile)
  • Interprets WASM modules without a browser (wasm-interp)

Architecture Overview

WABT is written in C/C++ with no external dependencies beyond the standard library. It includes a hand-written lexer and parser for WAT text, a binary reader/writer for WASM, and an IR that connects them. The interpreter executes WASM bytecode directly. All tools share the same internal module representation, ensuring consistent behavior.

Self-Hosting & Configuration

  • Install via Homebrew, apt, or download prebuilt binaries from GitHub releases
  • Build from source with CMake on Linux, macOS, or Windows
  • Tools are standalone executables with no runtime dependencies
  • Enable WASI support by building with -DWITH_WASI=ON
  • JavaScript/WebAssembly port available for browser-based use (wabt.js)

Key Features

  • Reference implementation aligned with the official WebAssembly specification
  • Support for WASM proposals (multi-memory, exception handling, GC, threads)
  • wasm-decompile produces readable pseudo-code from any WASM binary
  • wasm-interp runs WASM modules from the command line for quick testing
  • wabt.js enables WAT-to-WASM conversion directly in the browser

Comparison with Similar Tools

  • Binaryen — Focuses on optimization and code generation; WABT focuses on format conversion
  • wasm-tools (Bytecode Alliance) — Rust-based toolkit with similar goals; WABT is the C/C++ reference
  • Wasmtime — A WASM runtime; WABT provides tooling rather than execution
  • wasm-pack — Builds Rust projects to WASM; WABT works with raw WAT/WASM files

FAQ

Q: Is WABT the official WebAssembly toolchain? A: It is maintained under the WebAssembly GitHub organization and closely tracks the spec.

Q: Can WABT optimize WASM binaries? A: No, use Binaryen (wasm-opt) for optimization. WABT focuses on conversion and inspection.

Q: Does wasm-interp support WASI? A: Yes, when built with WASI support enabled.

Q: Can I use WABT in a browser? A: Yes, wabt.js compiles the toolkit to WebAssembly itself for in-browser use.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产