WebAssembly/binaryen

Optimizer and compiler/toolchain library for WebAssembly

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 34 minutes ago
Added to GitGenius on November 14th, 2024
Created on October 29th, 2015
Open Issues & Pull Requests: 560 (+0)
Number of forks: 881
Total Stargazers: 8,609 (+0)
Total Subscribers: 173 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 34.3 days
Mean response time: 940.5 days
90th percentile: 2858.9 days
Tracked items: 727

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 58% of open issues come from outside the core team, a mix of external reports and the maintainers' own roadmap. 67% of tracked open issues have had no activity in three months, so the open count overstates what is actively being worked. Only 6% of issues opened in the past year have been closed. Three people close 84% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 339
New in 7 days: 2
Closed in 7 days: 0
Avg open age: 1,211 days
Stale 30+ days: 329
Stale 90+ days: 319

Recent activity

Opened in 7 days: 2
Closed in 7 days: 0
Comments in 7 days: 3
Events in 7 days: 6

Top labels

  • help wanted (49)
  • good first bug (15)
  • interpreter (7)
  • enhancement (6)
  • plugins (2)
  • LLVM wasm backend (1)
  • Poppy IR (1)
  • bug (1)

Detailed Description

Binaryen is a compiler and toolchain infrastructure library for WebAssembly written in C++. It functions as both a standalone optimizer and a component library used by multiple major language toolchains. The project is designed around three core principles: making compilation to WebAssembly easy through simple APIs, fast through parallel processing and compact data structures, and effective through numerous optimization passes that reduce code size and improve performance.

The repository serves as a critical infrastructure component for the WebAssembly ecosystem. Major toolchains integrate Binaryen as a component, including Emscripten for C/C++ compilation, wasm-pack for Rust, J2CL and J2Wasm for Java, Kotlin/Wasm, Flutter for Dart, and wasm_of_ocaml for OCaml. Additionally, several compilers use Binaryen as a library, including AssemblyScript which compiles TypeScript variants to WebAssembly, wasm2js which converts WebAssembly to JavaScript, Asterius for Haskell compilation, and Grain for its own language compilation.

The core of Binaryen is its intermediate representation, which is designed to be both flexible for optimization and closely aligned with WebAssembly itself. The IR uses a tree structure rather than a stack machine format, making it convenient for optimization passes while remaining simple to convert to and from WebAssembly binary format. Binaryen IR includes features not present in standard WebAssembly, such as an unreachable type and support for tuple types in multivalue contexts, which enable local transformations without requiring global context awareness.

Beyond optimization, Binaryen provides comprehensive toolchain utilities. It can parse and emit WebAssembly, allowing users to load WebAssembly, optimize it, and re-emit it as a wasm-to-wasm optimizer. The library includes a WebAssembly interpreter capable of running spec tests, integrates with Emscripten for complete C and C++ compilation pipelines, and can polyfill WebAssembly by running it in a JavaScript-compiled interpreter for browsers lacking native support.

The project maintains active development with significant contributor engagement.

The repository's classification spans binary optimization, compilation tools, static analysis, testing frameworks, debugging, bytecode manipulation, transpilers, LLVM backend integration, validation, and verification. This breadth reflects Binaryen's role as a comprehensive WebAssembly infrastructure library.