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
-**Tiny**: TinyWasm is designed to be as small as possible without significantly compromising performance or functionality (< 4000 LLOC).
19
-
-**Portable**: TinyWasm runs on any platform that Rust can target, including `no_std`, with minimal external dependencies.
20
-
-**Safe**: No unsafe code is used in the runtime
5
+
-**Tiny**: Keeps the runtime small and focused while still being practical for real workloads.
6
+
-**Portable**: Runs anywhere Rust runs, supports `no_std`, and keeps external dependencies to a minimum.
7
+
-**Secure**: Written entirely safe Rust (`#[deny(unsafe_code)]`) and designed to prevent untrusted code from crashing the runtime
21
8
22
9
## Current Status
23
10
24
-
TinyWasm passes all WebAssembly MVP tests from the [WebAssembly core testsuite](https://github.com/WebAssembly/testsuite) and is able to run most WebAssembly programs. Additionally, the current 2.0 WebAssembly is mostly supported, with the exception of the SIMD and Memory64 proposals. See the [Supported Proposals](#supported-proposals) section for more information.
25
-
26
-
## Safety
27
-
28
-
Safety wise, TinyWasm doesn't use any unsafe code and is designed to be completely memory-safe. Untrusted WebAssembly code should not be able to crash the runtime or access memory outside of its sandbox, however currently there is no protection against infinite loops or excessive memory usage. Unvalidated Wasm and untrusted, precompilled twasm bytecode is safe to run too but can crash the runtime.
`tinywasm` passes all WebAssembly MVP and WebAssembly 2.0 tests from the [WebAssembly core testsuite](https://github.com/WebAssembly/testsuite) and is able to run most WebAssembly programs. Additionally, support for WebAssembly 3.0 is mostly done. See the [Supported Proposals](#supported-proposals) section for more information.
50
12
51
13
## Usage
52
14
53
-
See the [examples](./examples) directory and [documentation](https://docs.rs/tinywasm) for more information on how to use TinyWasm.
15
+
See the [examples](./examples) directory and [documentation](https://docs.rs/tinywasm) for more information on how to use `tinywasm`.
54
16
For testing purposes, you can also use the `tinywasm-cli` tool:
55
17
56
18
```sh
@@ -69,21 +31,53 @@ $ tinywasm-cli --help
69
31
-**`archive`**\
70
32
Enables pre-parsing of archives. This is enabled by default.
71
33
72
-
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](https://github.com/rust-lang/rfcs/issues/2505)), especially on `wasm32` targets.
34
+
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](https://github.com/rust-lang/rfcs/issues/2505)), especially on `wasm32` targets.
35
+
36
+
## Safety
73
37
74
-
## Inspiration
38
+
Untrusted WebAssembly code should not be able to crash the runtime or access memory outside of its sandbox. Unvalidated Wasm and untrusted, precompiled twasm bytecode is safe to run as well, but can lead to panics if the bytecode is malformed. In general, it is recommended to validate Wasm bytecode before running it, and to only run trusted twasm bytecode.
75
39
76
-
Big thanks to the authors of the following projects, which have inspired and influenced TinyWasm:
40
+
## Supported Proposals
77
41
78
-
-[wasmi](https://github.com/wasmi-labs/wasmi) - an efficient and lightweight WebAssembly interpreter that also runs in `no_std` environments
79
-
-[wasm3](https://github.com/wasm3/wasm3) - a high-performance WebAssembly interpreter written in C
I encourage you to check these projects out if you're looking for more mature and feature-complete WebAssembly runtimes:
73
+
74
+
-[wasmi](https://github.com/wasmi-labs/wasmi) - efficient and versatile WebAssembly interpreter for embedded systems
75
+
-[wasm3](https://github.com/wasm3/wasm3) - a fast WebAssembly interpreter written in C
80
76
-[wazero](https://wazero.io/) - a zero-dependency WebAssembly interpreter written in Go
81
77
-[wain](https://github.com/rhysd/wain) - a zero-dependency WebAssembly interpreter written in Rust
82
78
83
-
I encourage you to check these projects out if you're looking for more mature and feature-complete WebAssembly runtimes.
84
-
85
79
## License
86
80
87
81
Licensed under either of [Apache License, Version 2.0](./LICENSE-APACHE) or [MIT license](./LICENSE-MIT) at your option.
88
82
89
-
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.
83
+
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.
0 commit comments