# webassembly/binaryen

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/webassembly-binaryen).**

8,354 stars · 837 forks · WebAssembly · apache-2.0

## Links

- GitHub: https://github.com/WebAssembly/binaryen
- awesome-repositories: https://awesome-repositories.com/repository/webassembly-binaryen.md

## Topics

`c-plus-plus` `compilers` `emscripten` `hacktoberfest` `webassembly`

## Description

Binaryen is a WebAssembly compiler toolchain and optimizer designed to transform, validate, and shrink binary modules. It provides a comprehensive intermediate representation framework that converts binary code into a single-assignment form to enable advanced program analysis and code transformation.

The project includes a specialized transformation engine that applies iterative optimization passes to increase execution speed and reduce binary size. Additionally, it functions as a transpiler that translates WebAssembly binary modules into executable JavaScript for environments that lack native runtime support.

Its broader capabilities cover binary analysis, including assembly and disassembly, and the structural modification of modules through import minification and dead-code elimination. The toolset also supports quality assurance via random module generation, fuzzer-targeted test cases, and binary testcase reduction to preserve specific execution properties or crashes.

## Tags

### Programming Languages & Runtimes

- [Intermediate Representations](https://awesome-repositories.com/f/programming-languages-runtimes/compiler-interpreter-internals/compiler-infrastructure/intermediate-representations.md) — Provides a comprehensive intermediate representation framework that converts binary code into a single-assignment form.
- [Source-to-JavaScript Transpilers](https://awesome-repositories.com/f/programming-languages-runtimes/javascript-transpilers/source-to-javascript-transpilers.md) — Translates WebAssembly binary modules into executable JavaScript code for environments lacking native runtime support. ([source](https://github.com/WebAssembly/binaryen#readme))
- [Binary Module Generation](https://awesome-repositories.com/f/programming-languages-runtimes/binary-module-generation.md) — Builds binary files by defining functions, types, imports, exports, and static memory data. ([source](https://github.com/WebAssembly/binaryen/wiki/Compiling-to-WebAssembly-with-Binaryen))
- [Binary Parsing](https://awesome-repositories.com/f/programming-languages-runtimes/binary-parsing.md) — Implements raw binary parsing to convert WebAssembly modules into internal data structures for manipulation.
- [Constant Value Inference](https://awesome-repositories.com/f/programming-languages-runtimes/constant-value-inference.md) — Performs whole-program analysis to determine constant values and refine types across the entire module. ([source](https://github.com/WebAssembly/binaryen/wiki/Optimizer-Cookbook))
- [Control Flow Synthesis](https://awesome-repositories.com/f/programming-languages-runtimes/control-flow-synthesis.md) — Creates blocks, loops, and conditional statements to manage the execution paths of a program. ([source](https://github.com/WebAssembly/binaryen/wiki/binaryen.js-API))
- [JavaScript Code Generation](https://awesome-repositories.com/f/programming-languages-runtimes/javascript-code-generation.md) — Converts binary functions into valid JavaScript source code ensuring compatibility with scripting expression rules. ([source](https://github.com/WebAssembly/binaryen/blob/main/src/wasm2js.h))
- [WebAssembly](https://awesome-repositories.com/f/programming-languages-runtimes/javascript-transpilers/webassembly.md) — Translates WebAssembly binary modules into executable JavaScript for environments lacking native runtime support.
- [Monomorphization](https://awesome-repositories.com/f/programming-languages-runtimes/monomorphization.md) — Creates specialized duplicates of functions based on call-site constants to eliminate runtime overhead. ([source](https://github.com/WebAssembly/binaryen/wiki/Optimizer-Cookbook))
- [WebAssembly](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-execution-environments/webassembly.md) — Implements a comprehensive toolset for optimizing and managing portable WebAssembly binary code.
- [Toolchain Development Kits](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-execution-environments/webassembly/toolchain-development-kits.md) — Provides a framework for building custom tools to parse, modify, and generate WebAssembly binary and text formats.
- [Side-Effect Analysis](https://awesome-repositories.com/f/programming-languages-runtimes/side-effect-analysis.md) — Computes side effects for each function to allow the optimizer to move code past non-state-modifying calls. ([source](https://github.com/WebAssembly/binaryen/wiki/Optimizer-Cookbook))
- [Structured Control Flow Conversion](https://awesome-repositories.com/f/programming-languages-runtimes/structured-control-flow-conversion.md) — Transforms arbitrary graphs of basic blocks and branches into valid structured execution paths. ([source](https://github.com/WebAssembly/binaryen/wiki/Compiling-to-WebAssembly-with-Binaryen))
- [Static Single Assignment Analysis](https://awesome-repositories.com/f/programming-languages-runtimes/variable-assignments/static-single-assignment-analysis.md) — Transforms code into single-assignment form so each variable has one assignment to simplify optimization. ([source](https://github.com/WebAssembly/binaryen/blob/main/src/passes/SSAify.cpp))
- [WebAssembly Binary Analysis](https://awesome-repositories.com/f/programming-languages-runtimes/webassembly-binary-analysis.md) — Provides capabilities to convert binary modules into human-readable text and analyze stack signatures for debugging.
- [WebAssembly Binary Manipulators](https://awesome-repositories.com/f/programming-languages-runtimes/webassembly-binary-manipulators.md) — Ships a utility for assembling, disassembling, and manipulating WebAssembly files and their internal structural representations.
- [WebAssembly IR Frameworks](https://awesome-repositories.com/f/programming-languages-runtimes/webassembly-ir-frameworks.md) — Provides a comprehensive intermediate representation framework that converts binary code into single-assignment form for program analysis.
- [WebAssembly to JavaScript Transpilation](https://awesome-repositories.com/f/programming-languages-runtimes/webassembly-to-javascript-transpilation.md) — Translates WebAssembly binary modules into executable JavaScript for environments lacking native runtime support.
- [Compile-Time Expression Evaluation](https://awesome-repositories.com/f/programming-languages-runtimes/compile-time-expression-evaluation.md) — Executes parts of functions during the build process to compute results at compile-time. ([source](https://github.com/WebAssembly/binaryen#readme))
- [Constant Inference](https://awesome-repositories.com/f/programming-languages-runtimes/constant-inference.md) — Analyzes the entire module to determine constant values and refine types across all functions and globals.
- [Fixed-Point Optimization Convergence](https://awesome-repositories.com/f/programming-languages-runtimes/fixed-point-optimization-convergence.md) — Runs a suite of optimization passes in a loop until the binary size reaches a stable fixed point. ([source](https://github.com/WebAssembly/binaryen/wiki/Optimizer-Cookbook))
- [Fixed-Point Optimization Passes](https://awesome-repositories.com/f/programming-languages-runtimes/fixed-point-optimization-passes.md) — Runs a suite of transformation passes in a loop until the binary size or performance reaches a stable state.
- [Partial Inlining](https://awesome-repositories.com/f/programming-languages-runtimes/function-inliners/partial-inlining.md) — Inlines initial conditional branches of functions to reduce call overhead without inlining the entire body. ([source](https://github.com/WebAssembly/binaryen/wiki/Optimizer-Cookbook))
- [Trap Assumption Analysis](https://awesome-repositories.com/f/programming-languages-runtimes/trap-assumption-analysis.md) — Removes code on paths leading to traps by assuming they will not occur during execution. ([source](https://github.com/WebAssembly/binaryen/wiki/Optimizer-Cookbook))
- [WebAssembly Module Structural Definitions](https://awesome-repositories.com/f/programming-languages-runtimes/webassembly-module-structural-definitions.md) — Allows for the addition and removal of functions, global variables, imports, and exports to define the binary interface. ([source](https://github.com/WebAssembly/binaryen/wiki/binaryen.js-API))

### Web Development

- [WebAssembly Compilation](https://awesome-repositories.com/f/web-development/webassembly-compilation.md) — Functions as a complete compiler toolchain for optimizing, transforming, and validating WebAssembly binary modules.
- [Binary Optimizers](https://awesome-repositories.com/f/web-development/webassembly-compilation/binary-optimizers.md) — Provides a transformation engine that applies optimization passes to increase execution speed and reduce WebAssembly binary size. ([source](https://github.com/WebAssembly/binaryen/blob/main/.gitattributes))
- [Binary Module Linking](https://awesome-repositories.com/f/web-development/dynamic-loading-strategies/binary-module-loaders/binary-module-linking.md) — Combines several binary files into a single module by connecting imports to exports and resolving name conflicts. ([source](https://github.com/WebAssembly/binaryen/blob/main/README.md))

### Data & Databases

- [Binary Format Parsers](https://awesome-repositories.com/f/data-databases/data-processing-pipelines/data-transformation/data-parsing-extraction/binary-format-parsers.md) — Parses binary formats to convert them into internal representations for manipulation and re-emission. ([source](https://github.com/WebAssembly/binaryen#readme))

### Development Tools & Productivity

- [Binary Compilation Toolchains](https://awesome-repositories.com/f/development-tools-productivity/build-tooling/build-orchestration-logic/build-orchestration-configuration/build-automation-systems/build-systems/binary-compilation-toolchains.md) — Modifies the structure and contents of binary files to enable custom transformations or toolchain integration. ([source](https://github.com/WebAssembly/binaryen/blob/main/.gitattributes))
- [Stack Signature Analysis](https://awesome-repositories.com/f/development-tools-productivity/compiled-code-analysis/stack-signature-analysis.md) — Calculates and composes stack signatures to determine if instruction sequences are compatible or reachable. ([source](https://github.com/WebAssembly/binaryen/blob/main/src/ir/stack-utils.h))
- [Dead Code Elimination](https://awesome-repositories.com/f/development-tools-productivity/dead-code-elimination.md) — Prunes unused exports and functions through reachability analysis of internal entities and external references.
- [Automatic Export Removal](https://awesome-repositories.com/f/development-tools-productivity/dead-code-elimination/automatic-export-removal.md) — Deletes exported functions or globals from a module to reduce binary size after merging logic. ([source](https://github.com/WebAssembly/binaryen/blob/main/CHANGELOG.md))
- [Identifier Minification](https://awesome-repositories.com/f/development-tools-productivity/identifier-minification.md) — Renames imports and exports to shorter identifiers and outputs the mapping in JSON format to reduce size. ([source](https://github.com/WebAssembly/binaryen/blob/main/CHANGELOG.md))
- [Binary-to-Source Mapping](https://awesome-repositories.com/f/development-tools-productivity/source-code-mapping/binary-to-source-mapping.md) — Provides source map management to link compiled expressions back to original source code locations. ([source](https://github.com/WebAssembly/binaryen#readme))

### Operating Systems & Systems Programming

- [Binary Assembly](https://awesome-repositories.com/f/operating-systems-systems-programming/binary-analysis-capabilities/binary-assembly.md) — Converts human-readable text formats into binary data for machine execution. ([source](https://github.com/WebAssembly/binaryen/blob/main/README.md))
- [Binary Disassembly](https://awesome-repositories.com/f/operating-systems-systems-programming/binary-analysis-capabilities/binary-disassembly.md) — Converts binary format data into human-readable text for analysis and debugging. ([source](https://github.com/WebAssembly/binaryen/blob/main/README.md))
- [Binary Size Reduction](https://awesome-repositories.com/f/operating-systems-systems-programming/assembly-metadata-editors/binary-size-reduction.md) — Shrinks a binary file into a smaller version that preserves a specific property such as a virtual machine crash. ([source](https://github.com/WebAssembly/binaryen#readme))
- [Behavior-Preserving Binary Reduction](https://awesome-repositories.com/f/operating-systems-systems-programming/assembly-metadata-editors/binary-size-reduction/behavior-preserving-binary-reduction.md) — Shrinks large binary files into minimal versions that preserve specific execution properties or crashes. ([source](https://github.com/WebAssembly/binaryen/blob/main/README.md))

### Software Engineering & Architecture

- [Structured Control-Flow Reconstruction](https://awesome-repositories.com/f/software-engineering-architecture/control-flow-logic-models/control-flow-graph-generation/structured-control-flow-reconstruction.md) — Converts arbitrary graphs of basic blocks and branches into valid structured execution paths for binary emission.
- [IR Control Flow Rewriting](https://awesome-repositories.com/f/software-engineering-architecture/control-flow-optimization/ir-control-flow-rewriting.md) — Flattens the intermediate representation and regenerates the control flow graph to improve size and performance. ([source](https://github.com/WebAssembly/binaryen/wiki/Optimizer-Cookbook))

### Testing & Quality Assurance

- [Binary Specification Validation](https://awesome-repositories.com/f/testing-quality-assurance/binary-specification-validation.md) — Checks constructed modules for structural or logical errors to ensure adherence to the WebAssembly specification. ([source](https://github.com/WebAssembly/binaryen/wiki/Compiling-to-WebAssembly-with-Binaryen))
- [WebAssembly Fuzzing](https://awesome-repositories.com/f/testing-quality-assurance/fuzz-testing/webassembly-fuzzing.md) — Generates random modules and shrinks failing test cases to verify WebAssembly runtime stability.
- [Module Mutation Testing](https://awesome-repositories.com/f/testing-quality-assurance/module-mutation-testing.md) — Generates variations of a module using a random seed to verify runtime stability. ([source](https://github.com/WebAssembly/binaryen/wiki/Fuzzing))
- [Random Module Generation](https://awesome-repositories.com/f/testing-quality-assurance/random-module-generation.md) — Creates random test cases by converting arbitrary byte streams into valid modules to verify stability. ([source](https://github.com/WebAssembly/binaryen/wiki/Fuzzing))
- [Test Case Generators](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/test-execution-orchestration/test-case-generators.md) — Directs a fuzzer to target specific binary or text formats to discover edge cases. ([source](https://github.com/WebAssembly/binaryen/tree/main/fuzz))
- [Test Case Shrinking](https://awesome-repositories.com/f/testing-quality-assurance/test-case-shrinking.md) — Shrinks a binary module to its smallest size while preserving specific behaviors or outputs. ([source](https://github.com/WebAssembly/binaryen/wiki/Fuzzing))

### Part of an Awesome List

- [Frameworks and Tooling](https://awesome-repositories.com/f/awesome-lists/devtools/frameworks-and-tooling.md) — Compiler infrastructure for optimizing WebAssembly binary size.
