diff options
| -rw-r--r-- | CONTRIBUTING.md | 6 | ||||
| -rw-r--r-- | Cargo.lock | 32 | ||||
| -rw-r--r-- | README.md | 6 | ||||
| -rw-r--r-- | crates/tinywasm/src/lib.rs | 27 |
4 files changed, 41 insertions, 30 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8c00a34..bd91491 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,6 +13,12 @@ - **`cargo test-mvp`**\ Run the WebAssembly MVP (1.0) test suite. Be sure to cloned this repo with `--recursive` or initialize the submodules with `git submodule update --init --recursive` +- **`cargo test-2`**\ + Run the full WebAssembly test suite (2.0) + +- **`cargo benchmark <benchmark>`**\ + Run a single benchmark. e.g. `cargo benchmark argon2id` + - **`cargo test-wast <path>`**\ Run a single WAST test file. e.g. `cargo test-wast ./examples/wast/i32.wast` @@ -652,9 +652,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.4" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da01daa5f6d41c91358398e8db4dde38e292378da1f28300b59ef4732b879454" +checksum = "fc5d6b04b3fd0ba9926f945895de7d806260a2d7431ba82e7edaecb043c4c6b8" dependencies = [ "darling_core", "darling_macro", @@ -662,9 +662,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.4" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f44f6238b948a3c6c3073cdf53bb0c2d5e024ee27e0f35bfe9d556a12395808a" +checksum = "04e48a959bcd5c761246f5d090ebc2fbf7b9cd527a492b07a67510c108f1e7e3" dependencies = [ "fnv", "ident_case", @@ -675,9 +675,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.4" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d2d88bd93979b1feb760a6b5c531ac5ba06bd63e74894c377af02faee07b9cd" +checksum = "1d1545d67a2149e1d93b7e5c7752dce5a7426eb5d1357ddcfd89336b94444f77" dependencies = [ "darling_core", "quote", @@ -865,9 +865,9 @@ dependencies = [ [[package]] name = "eyre" -version = "0.6.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6267a1fa6f59179ea4afc8e50fd8612a3cc60bc858f786ff877a4a8cb042799" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" dependencies = [ "indenter", "once_cell", @@ -1095,9 +1095,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "iana-time-zone" -version = "0.1.59" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1223,9 +1223,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" @@ -1320,9 +1320,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", "simd-adler32", @@ -1770,9 +1770,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.30" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ "bitflags 2.4.2", "errno", @@ -13,14 +13,14 @@ ## Why TinyWasm? - **Tiny**: TinyWasm is designed to be as small as possible without significantly compromising performance or functionality. -- **Portable**: TinyWasm runs on any platform that LLVM supports, including WebAssembly itself, with minimal external dependencies. +- **Portable**: TinyWasm runs on any platform that Rust can target, including WebAssembly itself, 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](https://github.com/WebAssembly/testsuite). Work on the 2.0 tests is ongoing. This achievement ensures that TinyWasm can run most WebAssembly programs, including versions of TinyWasm itself compiled to WebAssembly (see [examples/wasm-rust.rs](./examples/wasm-rust.rs)). The results of the testsuite are available [here](https://github.com/explodingcamera/tinywasm/tree/main/crates/tinywasm/tests/generated). +As of version `0.3.0`, TinyWasm successfully passes all the WebAssembly 1.0 tests in the [WebAssembly Test Suite](https://github.com/WebAssembly/testsuite). Work on the 2.0 tests is ongoing. This enables TinyWasm to run most WebAssembly programs, including versions of TinyWasm itself compiled to WebAssembly (see [examples/wasm-rust.rs](./examples/wasm-rust.rs)). The results of the testsuites are available [here](https://github.com/explodingcamera/tinywasm/tree/main/crates/tinywasm/tests/generated). -The API is still unstable and may change at any time, so don't use it in production _yet_. Note that TinyWasm isn't primarily designed for high performance; its focus lies more on simplicity, size, and portability. More details on its performance aspects can be found in [BENCHMARKS.md](./BENCHMARKS.md). +The API is still unstable and may change at any time, so you probably don't want to use it in production _yet_. Note that TinyWasm isn't primarily designed for high performance; its focus lies more on simplicity, size, and portability. More details on its performance aspects can be found in [BENCHMARKS.md](./BENCHMARKS.md). ## Supported Proposals diff --git a/crates/tinywasm/src/lib.rs b/crates/tinywasm/src/lib.rs index 77ecb1e..583a68d 100644 --- a/crates/tinywasm/src/lib.rs +++ b/crates/tinywasm/src/lib.rs @@ -10,20 +10,25 @@ //! A tiny WebAssembly Runtime written in Rust //! //! TinyWasm provides a minimal WebAssembly runtime for executing WebAssembly modules. -//! It currently supports a subset of the WebAssembly MVP specification and is intended -//! to be useful for embedded systems and other environments where a full-featured -//! runtime is not required. +//! It currently supports all features of the WebAssembly MVP specification and is +//! designed to be easy to use and integrate in other projects. //! //! ## Features -//! - `std` (default): Enables the use of `std` and `std::io` for parsing from files and streams. -//! - `logging` (default): Enables logging via the `log` crate. -//! - `parser` (default): Enables the `tinywasm_parser` crate for parsing WebAssembly modules. +//!- **`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 //! -//! ## No-std support -//! TinyWasm supports `no_std` environments by disabling the `std` feature and registering -//! a custom allocator. This removes support for parsing from files and streams, -//! but otherwise the API is the same. -//! Additionally, to have proper error types, you currently need a `nightly` compiler to have the error trait in core. +//! With all these features disabled, TinyWasm only depends on `core`, `alloc` and `libm`. +//! By disabling `std`, you can use TinyWasm in `no_std` environments. This requires +//! a custom allocator and removes support for parsing from files and streams, but otherwise the API is the same. +//! Additionally, to have proper error types in `no_std`, you currently need a `nightly` compiler to use the unstable error trait in `core`. //! //! ## Getting Started //! The easiest way to get started is to use the [`Module::parse_bytes`] function to load a |
