Crates.io | tinywasm |
lib.rs | tinywasm |
version | 0.7.0 |
source | src |
created_at | 2023-12-09 14:11:06.473154 |
updated_at | 2024-05-15 11:58:16.203055 |
description | A tiny WebAssembly interpreter |
homepage | |
repository | https://github.com/explodingcamera/tinywasm |
max_upload_size | |
id | 1063701 |
size | 269,491 |
no_std
, with minimal external dependencies.rkyv
which uses unsafe code can be used for serialization, but it is optional).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.
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 |
TinyWasm can be used through the tinywasm-cli
CLI tool or as a library in your Rust project. Documentation can be found here.
$ cargo add tinywasm
The CLI is mainly available for testing purposes, but can also be used to run WebAssembly programs.
$ cargo install tinywasm-cli
$ tinywasm-cli --help
std
std
and std::io
for parsing from files and streams. This is enabled by default.logging
log
crate. This is enabled by default.parser
tinywasm-parser
crate. This is enabled by default.archive
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.
Big thanks to the authors of the following projects, which have inspired and influenced TinyWasm:
no_std
environmentsI encourage you to check these projects out if you're looking for a more mature and feature-complete WebAssembly interpreter.
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.