https://github.com/explodingcamera/tinywasm Skip to content Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} explodingcamera / tinywasm Public * Notifications * Fork 7 * Star 172 * A tiny, interpreted WebAssembly Runtime written in Rust License Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE-APACHE MIT LICENSE-MIT 172 stars 7 forks Branches Tags Activity Star Notifications * Code * Issues 1 * Pull requests 1 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights explodingcamera/tinywasm This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main BranchesTags Go to file Code Folders and files Name Name Last commit Last commit message date Latest commit History 240 Commits .cargo .cargo .github/workflows .github/workflows .vscode .vscode crates crates examples examples .gitignore .gitignore .gitmodules .gitmodules ARCHITECTURE.md ARCHITECTURE.md BENCHMARKS.md BENCHMARKS.md CHANGELOG.md CHANGELOG.md CONTRIBUTING.md CONTRIBUTING.md Cargo.lock Cargo.lock Cargo.toml Cargo.toml LICENSE-APACHE LICENSE-APACHE LICENSE-MIT LICENSE-MIT README.md README.md rust-toolchain.toml rust-toolchain.toml rustfmt.toml rustfmt.toml tinywasm.png tinywasm.png View all files Repository files navigation * README * Apache-2.0 license * MIT license [tinywasm] TinyWasm A tiny WebAssembly Runtime written in Rust docs.rs Crates.io Crates.io Why TinyWasm? * Tiny: TinyWasm is designed to be as small as possible without significantly compromising performance or functionality (< 6000 lines of code). * Portable: TinyWasm runs on any platform that Rust can target, including other WebAssembly Runtimes, with minimal external dependencies. * Lightweight: TinyWasm is easy to integrate and has a low call overhead, making it suitable for scripting and embedding. Status As of version 0.3.0, TinyWasm successfully passes all the WebAssembly 1.0 tests in the WebAssembly Test Suite. Work on the 2.0 tests is ongoing. This enables TinyWasm to run most WebAssembly programs, including executing TinyWasm itself compiled to WebAssembly (see examples/wasm-rust.rs). The results of the testsuites are available here. The API is still unstable and may change at any time, so you probably don't want to use it in production yet. TinyWasm isn't primarily designed for high performance; it focuses more on simplicity, size, and portability. More details on its performance can be found in BENCHMARKS.md. Future Development: The first major version will focus on improving the API and adding support for WASI. While doing so, I also want to further simplify and reduce the codebase's size and improve the parser's performance. Supported Proposals Proposal Implementation Status Version Mutable Globals Fully implemented 0.2.0 Multi-value Fully implemented 0.2.0 Sign-extension operators Fully implemented 0.2.0 Bulk Memory Operations Fully implemented 0.4.0 Reference Types Partially implemented N/A Multiple Memories Partially implemented N/A Memory64 Partially implemented N/A Usage TinyWasm can be used through the tinywasm-cli CLI tool or as a library in your Rust project. Documentation can be found here. Library $ cargo add tinywasm CLI The CLI is mainly available for testing purposes, but can also be used to run WebAssembly programs. $ cargo install tinywasm-cli $ tinywasm-cli --help Feature Flags * std Enables the use of std and std::io for parsing from files and streams. This is enabled by default. * logging Enables logging using the log crate. This is enabled by default. * parser Enables the tinywasm-parser crate. This is enabled by default. * archive Enables pre-parsing of archives. This is enabled by default. * unsafe Uses unsafe code to improve performance, particularly in Memory access. With all these features disabled, TinyWasm only depends on core, alloc ,and libm and can be used in no_std environments. Since libm is not as performant as the compiler's math intrinsics, it is recommended to use the std feature if possible (at least for now), especially on wasm32 targets. Inspiration Big thanks to the authors of the following projects, which have inspired and influenced TinyWasm: * wasmi - an efficient and lightweight WebAssembly interpreter that also runs on no_std environments * wasm3 - a high performance WebAssembly interpreter written in C * wazero - a zero-dependency WebAssembly interpreter written in go * wain - a zero-dependency WebAssembly interpreter written in Rust I encourage you to check these projects out if you're looking for a more mature and feature-complete WebAssembly interpreter. License Licensed under either of Apache License, Version 2.0 or MIT license at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in TinyWasm by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. Note: The GitHub repository contains a Submodule (crates/ tinywasm-parser/data) which is licensed only under the Apache License, Version 2.0. This data is generated from the WebAssembly Specification and is only used for testing purposes and not included in the final binary. About A tiny, interpreted WebAssembly Runtime written in Rust Topics rust embedded webassembly webassembly-runtime Resources Readme License Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE-APACHE MIT LICENSE-MIT Activity Stars 172 stars Watchers 3 watching Forks 7 forks Report repository Releases 6 v0.5.0 Latest Mar 1, 2024 + 5 releases Languages * Rust 100.0% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.