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

Skip to content

Commit 40e570c

Browse files
chore: update deps, spelling
Signed-off-by: Henry Gressmann <[email protected]>
1 parent 1a64f40 commit 40e570c

File tree

11 files changed

+129
-83
lines changed

11 files changed

+129
-83
lines changed

Cargo.lock

Lines changed: 43 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ default-members=[".", "crates/tinywasm", "crates/types", "crates/parser"]
44
resolver="2"
55

66
[workspace.dependencies]
7-
wast="222"
8-
wat="1.222"
7+
wast="223"
8+
wat="1.223"
99
eyre="0.6"
1010
log="0.4"
1111
pretty_env_logger="0.5"

README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
- **Tiny**: TinyWasm is designed to be as small as possible without significantly compromising performance or functionality (< 4000 LLOC).
1616
- **Portable**: TinyWasm runs on any platform that Rust can target, including `no_std`, with minimal external dependencies.
17-
- **Safe**: No unsafe code is used in the runtime (`rkyv` which uses unsafe code can be used for serialization, but is optional).
17+
- **Safe**: No unsafe code is used in the runtime (`rkyv`, which uses unsafe code, can be used for serialization but is optional).
1818

1919
## Status
2020

@@ -24,7 +24,7 @@ TinyWasm passes all WebAssembly MVP tests from the [WebAssembly core testsuite](
2424

2525
**Legend**\
2626
🌑 -- not available\
27-
🚧 -- in development / partialy supported\
27+
🚧 -- in development/partially supported\
2828
🟢 -- fully supported
2929

3030
| Proposal | Status | TinyWasm Version |
@@ -61,24 +61,21 @@ $ tinywasm-cli --help
6161
- **`archive`**\
6262
Enables pre-parsing of archives. This is enabled by default.
6363

64-
With all these features disabled, TinyWasm only depends on `core`, `alloc` ,and `libm` and can be used in `no_std` environments.
65-
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.
64+
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.
6665

6766
## Inspiration
6867

6968
Big thanks to the authors of the following projects, which have inspired and influenced TinyWasm:
7069

71-
- [wasmi](https://github.com/wasmi-labs/wasmi) - an efficient and lightweight WebAssembly interpreter that also runs on `no_std` environments
72-
- [wasm3](https://github.com/wasm3/wasm3) - a high performance WebAssembly interpreter written in C
73-
- [wazero](https://wazero.io/) - a zero-dependency WebAssembly interpreter written in go
70+
- [wasmi](https://github.com/wasmi-labs/wasmi) - an efficient and lightweight WebAssembly interpreter that also runs in `no_std` environments
71+
- [wasm3](https://github.com/wasm3/wasm3) - a high-performance WebAssembly interpreter written in C
72+
- [wazero](https://wazero.io/) - a zero-dependency WebAssembly interpreter written in Go
7473
- [wain](https://github.com/rhysd/wain) - a zero-dependency WebAssembly interpreter written in Rust
7574

76-
I encourage you to check these projects out if you're looking for more mature and feature-complete WebAssembly Runtimes.
75+
I encourage you to check these projects out if you're looking for more mature and feature-complete WebAssembly runtimes.
7776

7877
## License
7978

8079
Licensed under either of [Apache License, Version 2.0](./LICENSE-APACHE) or [MIT license](./LICENSE-MIT) at your option.
8180

8281
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-
84-
**Note:** The GitHub repository contains a Submodule (`crates/tinywasm-parser/data`) which is licensed only under the [Apache License, Version 2.0](https://github.com/WebAssembly/spec/blob/main/test/LICENSE). This data is generated from the [WebAssembly Specification](https://github.com/WebAssembly/spec/tree/main/test) and is only used for testing purposes and not included in the final binary.

crates/parser/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repository.workspace=true
99
rust-version.workspace=true
1010

1111
[dependencies]
12-
wasmparser={version="0.222", default-features=false, features=["validate", "features", "simd"]}
12+
wasmparser={version="0.223", default-features=false, features=["validate", "features", "simd"]}
1313
log={workspace=true, optional=true}
1414
tinywasm-types={version="0.9.0-alpha.0", path="../types", default-features=false}
1515

crates/tinywasm/tests/test-wasm-3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use testsuite::TestSuite;
44
use wasm_testsuite::data::{spec, SpecVersion};
55

66
fn main() -> Result<()> {
7-
if std::env::args().find(|x| x == "--enable").is_none() {
7+
if !std::env::args().any(|x| &x == "--enable") {
88
println!("Skipping wasm-3 tests, use --enable to run");
99
return Ok(());
1010
}

crates/tinywasm/tests/testsuite/run.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use log::{debug, error, info};
88
use tinywasm::{Extern, Imports, ModuleInstance};
99
use tinywasm_types::{ExternVal, MemoryType, ModuleInstanceAddr, TableType, ValType, WasmValue};
1010
use wasm_testsuite::data::TestFile;
11-
use wasm_testsuite::wast::{lexer::Lexer, parser::ParseBuffer, Wast};
1211
use wasm_testsuite::wast;
12+
use wasm_testsuite::wast::{lexer::Lexer, parser::ParseBuffer, Wast};
1313

1414
#[derive(Default)]
1515
struct ModuleRegistry {
@@ -171,7 +171,7 @@ impl TestSuite {
171171
Ok(())
172172
}
173173

174-
pub fn run_file<'a>(&mut self, file: TestFile<'a>) -> Result<()> {
174+
pub fn run_file(&mut self, file: TestFile<'_>) -> Result<()> {
175175
let test_group = self.test_group(file.name(), file.parent());
176176
let wast_raw = file.raw();
177177
let wast = file.wast()?;

crates/tinywasm/tests/testsuite/util.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,15 @@ fn wastarg2tinywasmvalue(arg: wast::WastArg) -> Result<tinywasm_types::WasmValue
120120
fn wast_i128_to_i128(i: wast::core::V128Pattern) -> u128 {
121121
match i {
122122
wast::core::V128Pattern::F32x4(f) => {
123-
f.iter().fold(0, |acc, &f| acc << 32 | nanpattern2tinywasmvalue(f).unwrap().as_f32().unwrap() as u128)
123+
f.iter().fold(0, |acc, &f| (acc << 32) | nanpattern2tinywasmvalue(f).unwrap().as_f32().unwrap() as u128)
124124
}
125125
wast::core::V128Pattern::F64x2(f) => {
126-
f.iter().fold(0, |acc, &f| acc << 64 | nanpattern2tinywasmvalue(f).unwrap().as_f64().unwrap() as u128)
126+
f.iter().fold(0, |acc, &f| (acc << 64) | nanpattern2tinywasmvalue(f).unwrap().as_f64().unwrap() as u128)
127127
}
128-
wast::core::V128Pattern::I16x8(f) => f.iter().fold(0, |acc, &f| acc << 16 | f as u128),
129-
wast::core::V128Pattern::I32x4(f) => f.iter().fold(0, |acc, &f| acc << 32 | f as u128),
130-
wast::core::V128Pattern::I64x2(f) => f.iter().fold(0, |acc, &f| acc << 64 | f as u128),
131-
wast::core::V128Pattern::I8x16(f) => f.iter().fold(0, |acc, &f| acc << 8 | f as u128),
128+
wast::core::V128Pattern::I16x8(f) => f.iter().fold(0, |acc, &f| (acc << 16) | f as u128),
129+
wast::core::V128Pattern::I32x4(f) => f.iter().fold(0, |acc, &f| (acc << 32) | f as u128),
130+
wast::core::V128Pattern::I64x2(f) => f.iter().fold(0, |acc, &f| (acc << 64) | f as u128),
131+
wast::core::V128Pattern::I8x16(f) => f.iter().fold(0, |acc, &f| (acc << 8) | f as u128),
132132
}
133133
}
134134

examples/archive.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ const WASM: &str = r#"
1111
"#;
1212

1313
fn main() -> Result<()> {
14-
let wasm = wat::parse_str(WASM).expect("failed to parse wat");
14+
let wasm = wat::parse_str(WASM).expect("Failed to parse WAT");
1515
let module = Parser::default().parse_module_bytes(wasm)?;
1616
let twasm = module.serialize_twasm();
1717

18-
// now, you could e.g. write twasm to a file called `add.twasm`
19-
// and load it later in a different program
18+
// Now, you could e.g. write `twasm` to a file called `add.twasm`
19+
// and load it later in a different program.
2020

2121
let module: Module = TinyWasmModule::from_twasm(&twasm)?.into();
2222
let mut store = Store::default();

0 commit comments

Comments
 (0)