Awesome Rust and Webassembly
A list of awesome Rust and WebAssembly projects, libraries, tools, and resources.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Table of Contents
- Development Tools
macro_railroad — Generating "railroad style" syntax diagrams for
macro_rules!()macros. Diagrams are generated fully automatically from rust-source as Scalable Vector Graphics, using customizable CSS for layout.
snowhash — Procedurally generate a unique snowflake from a hash.
wasmbooth — Video effect booth written in Rust and WebAssembly.
Build and Workflow Orchestration
- wasm-pack —
wasm-objdump — Print low-level details about a
.wasmbinary and each of its sections. Also supports disassembling into the WAT text format. It's like
objdumpbut for WebAssembly.
wasm-nm — List the imported, exported, and private function symbols defined within a
.wasmbinary. It's like
nmbut for WebAssembly.
wasm-gc — A small tool to garbage collect a WebAssembly module and remove all unneeded exports, imports, functions, etc. This is effectively a
--gc-sectionslinker flag for WebAssembly.
wasm-opt — The
wasm-opttool reads WebAssembly as input, runs transformation, optimization, and/or instrumentation passes on it, and then emits the transformed WebAssembly as output. Running it on the
.wasmbinaries produced by LLVM by way of
rustcwill usually create
.wasmbinaries that are both smaller and execute faster.
wasm-snipreplaces a WebAssembly function's body with an
unreachableinstruction. This is useful for forcibly removing Rust's panicking infrastructure in non-debug production builds.
- twiggy —
twiggyis a code size profiler for
.wasmbinaries. It analyzes a binary's call graph to answer questions about which functions take up the most space.
- wasm2js — The
wasm2jstool compiles WebAssembly into "almost asm.js". This is great for supporting browsers that don't have a WebAssembly implementation, such as Internet Explorer 11.
rs-jest — Jest preprocessor/transformer for Rust. Build for seamless integration with a project that use rollup-plugin-rust.
rust-native-wasm-loader — A Webpack loader that loads Rust code as a WebAssembly module. It uses the native Rust support for compiling to wasm32 and does not require Emscripten.
wasm-pack-plugin — Webpack plugin for Rust and
Allocation and Memory Management
- wee_alloc — The Wasm-Enabled, Elfin Allocator. A small (~1K uncompressed
.wasm) allocator implementation for when code size is a greater concern than allocation performance.
- console_error_panic_hook — This crate lets you debug panics on
wasm32-unknown-unknownby providing a panic hook that forwards panic messages to
- gate — Gate is a game development library tailored to 2D pixel-art games, written in Rust.
js-sys — Raw
eval, etc. These APIs are portable across all standard ECMAScript environments, not just the Web, such as Node.js.
wasm-bindgen-futuresis a bridge connecting JavaSript
Promises and Rust
Futures. It can convert in both directions and is useful when working with asynchronous tasks in Rust, and allows interacting with DOM events and I/O operations.
Interpreting and Compiling WebAssembly
cranelift-wasm — Compile WebAssembly to the native host's machine code. Part of the Cranelift (né Cretonne) code generator project.
wasmer — Standalone JIT WebAssembly runtime.
wasmi — An embeddable WebAssembly interpreter.
Parsing and Generating
parity-wasm — Low-level WebAssembly format library for serializing, deserializing, and building
.wasmbinaries. Good support for well-known custom sections, such as the "names" section.
wasmparser — A simple, event-driven library for parsing WebAssembly binary files.
- The Rust and WebAssembly Book — The official Rust and WebAssembly book authored by the Rust and WebAssembly domain working group.