A Rust library and CLI tool for high-level interoperability between WebAssembly modules and JavaScript.
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.
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.
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.
Facilitating high-level interactions between Wasm modules and JavaScript
Only generates glue code for specific JavaScript imports and Rust exports used, keeping WebAssembly modules small as emphasized in the README's lightweight feature.
Enables importing WebAssembly as ECMAScript modules, ensuring compatibility with future WebAssembly-ES module integration standards, as highlighted in the features.
Provides statically type-checked bindings between Rust and JavaScript, reducing runtime errors and improving code reliability, as demonstrated in the example.
Designed with the Web IDL bindings proposal for direct, fast DOM manipulation without JavaScript shims, aiming for performance gains beyond current implementations.
Requires installing and managing the wasm-bindgen CLI and Rust compiler, adding complexity to the build process compared to pure JavaScript solutions.
Optimizations like fast DOM access rely on the Web IDL bindings proposal, which is not yet universally implemented, limiting immediate performance benefits.
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.
A Python Interpreter written in Rust
Rust bindings for the Python interpreter
Rust bindings for writing safe and fast native Node.js modules.
📦✨ your favorite rust -> wasm workflow tool!
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.