• Stars
    star
    1,270
  • Rank 37,046 (Top 0.8 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CLI and Rust libraries for low-level manipulation of WebAssembly modules

wasm-tools

A Bytecode Alliance project

Rust tooling for low-level manipulation of WebAssembly modules

Installation

This project can be installed and compiled from source with this Cargo command:

$ cargo install wasm-tools

Additionally there are precompiled artifacts built on CI which are available for download as well.

Installation can be confirmed with:

$ wasm-tools --version

Subcommands can be explored with:

$ wasm-tools help

Tools included

The wasm-tools binary internally contains a number of subcommands for working with wasm modules. Many subcommands also come with Rust crates that can be use programmatically as well:

Tool Crate Description
wasm-tools validate wasmparser Validate a WebAssembly file
wasm-tools parse wat and wast Translate the WebAssembly text format to binary
wasm-tools print wasmprinter Translate the WebAssembly binary format to text
wasm-tools smith wasm-smith Generate a "random" valid WebAssembly module
wasm-tools mutate wasm-mutate Mutate an input wasm file into a new valid wasm file
wasm-tools shrink wasm-shrink Shrink a wasm file while preserving a predicate
wasm-tools dump Print debugging information about the binary format
wasm-tools objdump Print debugging information about section headers
wasm-tools strip Remove custom sections from a WebAssembly file
wasm-tools demangle Demangle Rust and C++ symbol names in the name section
wasm-tools compose wasm-compose Compose wasm components together
wasm-tools component new wit-component Create a component from a core wasm binary
wasm-tools component wit Extract a *.wit interface from a component
wasm-tools component embed Embed a component-type custom section in a core wasm binary
wasm-tools metadata show wasm-metadata Show name and producer metadata in a component or module
wasm-tools metadata add Add name or producer metadata to a component or module
wasm-tools addr2line Translate wasm offsets to filename/line numbers with DWARF

The wasm-tools CLI is primarily intended to be a debugging aid. The various subcommands all have --help explainer texts to describe more about their functionality as well.

Libraries

As mentioned above many of the tools of the wasm-tools CLI have libraries implemented in this repository as well. These libraries are:

  • wasmparser - a library to parse WebAssembly binaries
  • wat - a library to parse the WebAssembly text format
  • wast - like wat, except provides an AST
  • wasmprinter - prints WebAssembly binaries in their string form
  • wasm-mutate - a WebAssembly test case mutator
  • wasm-shrink - a WebAssembly test case shrinker
  • wasm-smith - a WebAssembly test case generator
  • wasm-encoder - a crate to generate a binary WebAssembly module
  • wit-parser - a crate to parse and manage *.wit files and interfaces.
  • wit-component - a crate to create components from core wasm modules.
  • wasm-metadata - a crate to manipulate name and producer metadata (custom sections) in a wasm module or component.

It's recommended to use the libraries directly rather than the CLI tooling when embedding into a separate project.

C/C++ bindings

Using the CMakeLists.txt in crates/c-api, wasm-tools can be used from the wasm-tools.h header.

License

This project is licensed under the Apache 2.0 license with the LLVM exception. See LICENSE for more details.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.

More Repositories

1

wasmtime

A fast and secure runtime for WebAssembly
Rust
15,075
star
2

wasm-micro-runtime

WebAssembly Micro Runtime (WAMR)
C
4,925
star
3

lucet

Lucet, the Sandboxing WebAssembly Compiler.
Rust
4,065
star
4

cranelift

Cranelift code generator
2,488
star
5

javy

JS to WebAssembly toolchain
Rust
2,240
star
6

rustix

Safe Rust bindings to POSIX-ish APIs
Rust
1,424
star
7

wit-bindgen

A language binding generator for WebAssembly interface types
Rust
1,024
star
8

wizer

The WebAssembly Pre-Initializer
Rust
932
star
9

wasmtime-go

Go WebAssembly runtime powered by Wasmtime
Go
771
star
10

cap-std

Capability-oriented version of the Rust standard library
Rust
646
star
11

cranelift-jit-demo

JIT compiler and runtime for a toy language, using Cranelift
Rust
636
star
12

jco

JavaScript toolchain for working with WebAssembly Components
Rust
598
star
13

cargo-component

A Cargo subcommand for creating WebAssembly components based on the component model proposal.
Rust
468
star
14

cargo-wasi

A lightweight Cargo subcommand to build Rust code for the `wasm32-wasi` target
Rust
439
star
15

wasmtime-dotnet

.NET embedding of Wasmtime https://bytecodealliance.github.io/wasmtime-dotnet/
C#
409
star
16

wasmtime-py

Python WebAssembly runtime powered by Wasmtime
Python
385
star
17

wasi-rs

Experimental WASI API bindings for Rust
Rust
254
star
18

ComponentizeJS

JS -> WebAssembly Component
Rust
213
star
19

wasi.dev

JavaScript
209
star
20

regalloc2

A new register allocator
Rust
200
star
21

registry

WebAssembly Registry (Warg)
Rust
189
star
22

wasmparser

A simple event-driven library for parsing WebAssembly binary files
178
star
23

wasmtime-demos

Historical and dated demos for Wasmtime usage and WASI content
C#
153
star
24

WASI-Virt

Virtual implementations of WASI APIs
Rust
139
star
25

componentize-py

Rust
138
star
26

wrpc

Wasm component-native RPC framework
Rust
114
star
27

wat

Rust WAT and WAST parser (WebAssembly Text Format)
113
star
28

wac

WebAssembly Composition (WAC) tooling
Rust
107
star
29

regalloc.rs

Modular register allocator algorithms
Rust
106
star
30

wasmtime-rb

Ruby WebAssembly runtime powered by Wasmtime
Rust
95
star
31

spidermonkey-wasm-rs

Rust
87
star
32

wasmtime-cpp

C++
81
star
33

preview2-prototyping

Polyfill adapter for preview1-using wasm modules to call preview2 functions.
Rust
79
star
34

wasm-interface-types

Raw Rust toolchain support for Wasm Interface Types
Rust
70
star
35

component-docs

Documentation around creating and using WebAssembly Components
Rust
68
star
36

sightglass

A benchmark suite and tool to compare different implementations of the same primitives.
C
67
star
37

wasm-tools-go

WebAssembly + Component Model tools for Go
Go
60
star
38

rfcs

RFC process for Bytecode Alliance projects
60
star
39

StarlingMonkey

The StarlingMonkey JS runtime
C++
58
star
40

wasm-pkg-tools

Rust
56
star
41

target-lexicon

Target "triple" support
Rust
48
star
42

wit-deps

WIT dependency manager
Rust
47
star
43

userfaultfd-rs

Rust bindings for the Linux userfaultfd functionality
Rust
43
star
44

wasi-nn

High-level bindings for wasi-nn system calls
CSS
42
star
45

system-interface

Extensions to the Rust standard library
Rust
41
star
46

waffle

Wasm Analysis Framework For Lightweight Experiments
Rust
34
star
47

wasmprinter

Rust library to print a WebAssembly binary to its textual format
32
star
48

wasm-component-ld

Command line linker for creating WebAssembly components
Rust
31
star
49

meetings

Python
28
star
50

wamr-rust-sdk

Rust
28
star
51

wasm-score

A benchmark for standalone WebAssembly
C
26
star
52

weval

the WebAssembly partial evaluator
Rust
25
star
53

spidermonkey-wasm-build

Utilities to compile SpiderMonkey to wasm32-wasi
JavaScript
24
star
54

vscode-wit

Visual Studio Code extension to recognize and highlight the WebAssembly Interface Type (WIT) IDL.
TypeScript
22
star
55

filecheck

Library for writing tests for utilities that read text files and produce text output
Rust
21
star
56

componentize-dotnet

Tooling for creating WebAssembly components from C#
C#
17
star
57

cranelift.vim

Vim editor configuration for working with cranelift IR (clif) files
Vim Script
15
star
58

arf-strings

Encoding and decoding for ARF strings
C
13
star
59

SIG-Guest-Languages

Special Interest Group (SIG) whose goal is to investigate how best to integrate Wasm and components into dynamic programming language ecosystems in a way that feels native to those ecosystems.
13
star
60

SIG-Registries

11
star
61

governance

11
star
62

subscribe-to-label-action

A GitHub action that allows users to subscribe to a label and automatically get @'d when the label is applied
JavaScript
11
star
63

bytecodealliance.org

CSS
10
star
64

wasm-spec-interpreter

Rust bindings for the Wasm spec interpreter.
Rust
10
star
65

spidermonkey-wasi-embedding

Shell
9
star
66

wamr-app-framework

WebAssembly Micro Runtime Application Framework
C
9
star
67

wasm-parallel-gzip

Some example scripts for building a parallel compression/decompression tool for WebAssembly
Makefile
8
star
68

fs-set-times

Set filesystem timestamps
Rust
6
star
69

wasmtime-libfuzzer-corpus

libFuzzer corpus for our wasmtime fuzz targets
Shell
6
star
70

rust-oci-wasm

A Rust implementation of the OCI artifact specification for WebAssembly
Rust
6
star
71

arena-btree

Rust
6
star
72

cm-go

Go
6
star
73

sig-embedded

6
star
74

wamr-python

Python
6
star
75

wamr.dev

The WAMR homepage
HTML
5
star
76

wasmtime.dev

The Wasmtime homepage
CSS
4
star
77

libc-test

Mirror of git://nsz.repo.hu:49100/repo/libc-test (see https://wiki.musl-libc.org/libc-test.html for more information)
C
4
star
78

actions

GitHub actions to setup wasm-tools and wasmtime
TypeScript
3
star
79

wasmtime-wasi-nn

2
star
80

cranelift.dev

CSS
1
star
81

label-messager-action

Automatically leave a message when an issue or pull request has a certain label
JavaScript
1
star
82

wasm-ml-meetings

Informal working group for machine learning and WebAssembly, especially wasi-nn
1
star