A WebAssembly interpreter written from scratch in safe Rust with zero dependencies.
wain is a WebAssembly interpreter implemented entirely in safe Rust, adhering to the official WebAssembly specification. It is built as a modular set of libraries for parsing, validating, and executing WebAssembly modules, emphasizing safety and dependency-free design. The project aims to provide a clean, educational implementation that enables deep understanding of the WebAssembly specification while maintaining practical efficiency.
Rust developers and educators who need a safe, dependency-free WebAssembly interpreter for learning, testing, or embedding in Rust projects. It is also suitable for developers prioritizing memory safety and modular architecture in their WebAssembly tooling.
Developers choose wain for its guarantee of memory safety through the exclusive use of safe Rust code and its zero external runtime dependencies, which reduces binary size and eliminates unsafe external code. Its modular architecture allows for reusable components in parsing, validation, and execution, offering flexibility for integration and customization.
WebAssembly implementation from scratch in Safe Rust with zero dependencies
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses no unsafe Rust code, eliminating undefined behavior and ensuring memory safety, as explicitly stated in the features list.
Has no external dependencies, reducing binary size and avoiding unsafe external code, which is a core design principle.
Separates parsing, validation, and execution into distinct crates (e.g., wain-syntax-binary, wain-exec), allowing for reusable components in custom tooling.
Supports custom external function implementations via the Importer trait, enabling flexible integration with Rust code, as shown in the examples.
Lacks many WebAssembly extensions like WASI, threads, and SIMD, and only runs one module at a time, as admitted in the 'Current restrictions' section.
Pre-v1.0.0 status means it's not production-ready; breaking changes are likely, and it hasn't passed all spec tests yet, per the roadmap.
Only provides basic C functions like putchar and getchar by default, requiring custom implementation for most real-world integrations, which adds complexity.