Giter VIP home page Giter VIP logo

wasm-tools's Introduction

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.

wasm-tools's People

Contributors

alexcrichton avatar fitzgen avatar yurydelendik avatar peterhuene avatar jacarte avatar sunfishcode avatar abrown avatar eqrion avatar robbepop avatar nagisa avatar venkkatesh-sekar avatar dependabot-preview[bot] avatar itsrainy avatar imikushin avatar takikawa avatar dicej avatar nlewycky avatar pchickey avatar rylev avatar fibonacci1729 avatar lars-t-hansen avatar guybedford avatar mossaka avatar bvisness avatar mbebenita avatar elliottt avatar silesmo avatar lann avatar silvanshade avatar esoterra avatar

Watchers

 avatar

Forkers

aegisfinance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.