Thanks to visit codestin.com
Credit goes to github.com

Skip to content

explodingcamera/tinywasm

Repository files navigation

TinyWasm

A tiny WebAssembly Runtime written in Rust

docs.rs Crates.io Crates.io

Status

TinyWasm, starting from version 0.3.0, passes all the WebAssembly 1.0 tests in the WebAssembly Test Suite. The 2.0 tests are in progress (notably simd and bulk-memory-operations are not implemented yet). This is enough to run most WebAssembly programs, including TinyWasm itself compiled to WebAssembly (see examples/wasm-rust.rs).

Some APIs to interact with the runtime are not yet exposed, and the existing ones are subject to change, but the core functionality is mostly complete. Results of the tests can be found here.

TinyWasm is not designed for performance, but rather for size and portability. However, it is still reasonably fast. There are a couple of low-hanging fruits on the performance side, but they are not a priority at the moment.

Supported Proposals

Usage

TinyWasm can be used through the tinywasm-cli CLI tool or as a library in your Rust project. Documentation can be found here.

CLI

$ cargo install tinywasm-cli
$ tinywasm-cli --help

Library

$ cargo add tinywasm

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.

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 built-in math intrinsics, it is recommended to use the std feature if possible (at least for now).

Performance

Benchmarks are coming soon.

📄 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

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Contributors 5

Languages