Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Rust
  3. wasm-bindgen

wasm-bindgen

Apache-2.0Rust0.2.118

A Rust library and CLI tool for high-level interoperability between WebAssembly modules and JavaScript.

Visit WebsiteGitHubGitHub
9.0k stars1.2k forks0 contributors

What is wasm-bindgen?

wasm-bindgen is a Rust library and CLI tool that facilitates high-level interactions between WebAssembly modules and JavaScript. It allows developers to seamlessly import JavaScript functions into Rust and export Rust functions to JavaScript, enabling type-safe interoperability for web applications built with WebAssembly. It solves the problem of low-level, cumbersome communication between Wasm and JS by providing ergonomic abstractions.

Target Audience

Rust developers building web applications or libraries with WebAssembly who need to interact with JavaScript APIs, the DOM, or browser features. It's also for teams integrating WebAssembly performance into existing JavaScript codebases.

Value Proposition

Developers choose wasm-bindgen for its lightweight, type-safe bindings that only include what you use, its alignment with future Web standards like ECMAScript module integration, and its design for fast DOM access. It's the standard tool for Rust and WebAssembly interoperability, backed by the Rust and WebAssembly Working Group.

Overview

Facilitating high-level interactions between Wasm modules and JavaScript

Use Cases

Best For

  • Calling browser APIs and DOM methods from Rust-compiled WebAssembly
  • Exposing high-performance Rust algorithms to JavaScript web applications
  • Building web frontends with Rust and WebAssembly for type-safe UI logic
  • Creating WebAssembly libraries intended for use in JavaScript ecosystems
  • Integrating Rust code into existing JavaScript projects via WebAssembly modules
  • Developing web tools or games where Rust handles compute-intensive tasks

Not Ideal For

  • Teams with no Rust expertise who want to avoid learning a new language and toolchain
  • Projects requiring zero-configuration setup and minimal build steps, like static site generators
  • Applications targeting environments where WebAssembly support is limited or unnecessary, such as certain IoT devices or legacy browsers
  • Developers seeking drop-in, pre-built UI components without custom Rust integration

Pros & Cons

Pros

Minimal Bundle Footprint

Only generates glue code for specific JavaScript imports and Rust exports used, keeping WebAssembly modules small as emphasized in the README's lightweight feature.

ES Module Standard Alignment

Enables importing WebAssembly as ECMAScript modules, ensuring compatibility with future WebAssembly-ES module integration standards, as highlighted in the features.

Type-Safe Interoperability

Provides statically type-checked bindings between Rust and JavaScript, reducing runtime errors and improving code reliability, as demonstrated in the example.

Future-Optimized DOM Access

Designed with the Web IDL bindings proposal for direct, fast DOM manipulation without JavaScript shims, aiming for performance gains beyond current implementations.

Cons

Rust Toolchain Dependency

Requires installing and managing the wasm-bindgen CLI and Rust compiler, adding complexity to the build process compared to pure JavaScript solutions.

Dependent on Unfinalized Standards

Optimizations like fast DOM access rely on the Web IDL bindings proposal, which is not yet universally implemented, limiting immediate performance benefits.

Limited Non-Browser Support

Primarily focused on web browsers; using it in server-side or Node.js contexts may require additional configuration and lacks comprehensive documentation for edge cases.

Frequently Asked Questions

Quick Stats

Stars8,967
Forks1,208
Contributors0
Open Issues468
Last commit2 days ago
CreatedSince 2017

Tags

#javascript-interop#webassembly#cli-tool#rust-wasm#wasm#type-safe#javascript#web-development#rust#binding-generator

Built With

R
Rust

Links & Resources

Website

Included in

Rust56.6k
Auto-fetched 1 day ago

Related Projects

RustPythonRustPython

A Python Interpreter written in Rust

Stars22,027
Forks1,428
Last commit1 day ago
PyO3PyO3

Rust bindings for the Python interpreter

Stars15,606
Forks961
Last commit7 days ago
NeonNeon

Rust bindings for writing safe and fast native Node.js modules.

Stars8,407
Forks286
Last commit4 days ago
wasm-packwasm-pack

📦✨ your favorite rust -> wasm workflow tool!

Stars7,153
Forks481
Last commit9 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub