Skip to content

Commit ba76508

Browse files
chore: prepare v0.9.0
Signed-off-by: Henry <mail@henrygressmann.de>
1 parent f328442 commit ba76508

27 files changed

Lines changed: 54 additions & 73 deletions

CHANGELOG.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [0.9.0] - 2026-05-05
9+
10+
**All Commits**: https://github.com/explodingcamera/tinywasm/compare/v0.8.0...v0.9.0
911

1012
This release is a major runtime and API rework. It adds support for several newer WebAssembly proposals, introduces the new `Engine` configuration API, rewrites large parts of execution and validation, and changes the internal `twasm` archive format. Benchmarks in the repository currently show roughly 30-90% improvement over 0.8.0 depending on workload and execution mode.
1113

1214
### Added
1315

1416
- Support for the `custom_page_sizes` proposal ([#22](https://github.com/explodingcamera/tinywasm/pull/22) by [@danielstuart14](https://github.com/danielstuart14))
1517
- Support for the `tail_call`, `memory64`, `simd`, `relaxed_simd`, `wide_arithmetic`, and `extended_const` proposals ([#37](https://github.com/explodingcamera/tinywasm/pull/37), [#38](https://github.com/explodingcamera/tinywasm/pull/38), [#39](https://github.com/explodingcamera/tinywasm/pull/39))
16-
- Parse-only support for the `annotations` proposal
1718
- New `Engine` API (`tinywasm::Engine` and `engine::Config`) for runtime configuration
1819
- Resumable execution APIs: `call_resumable`, `resume_with_fuel`, `resume_with_time_budget`, and `ExecProgress`
1920
- Host-function fuel APIs: `FuncContext::charge_fuel` and `FuncContext::remaining_fuel`
@@ -24,19 +25,18 @@ This release is a major runtime and API rework. It adds support for several newe
2425

2526
### Changed
2627

27-
- `Store::new` now takes an `Engine`; use `Store::default()` for default settings.
28+
- `Store::new` now takes an `Engine`, use `Store::default()` for default settings.
2829
- `ModuleInstance::func` now validates exact Wasm signatures at lookup time and fails immediately on mismatches.
29-
- Stack and call-stack limits now come from `engine::Config`, and memory allocation is lazy until first access.
30-
- Module-internal by-index inspection APIs are now gated behind `guest-debug`, and runtime `Debug` implementations are gated behind `debug`.
31-
- `Module` is now re-exported directly from `tinywasm_types`; the `module` submodule was removed.
30+
- Stack and call-stack limits can now be defined with `engine::Config`
31+
- Module-internal by-index inspection APIs are now gated behind `guest-debug`
32+
- `Debug` implementations are now gated behind `debug`.
3233
- MSRV increased to 1.95 and the crate now uses Rust 2024.
3334
- `Error`, `Trap`, and `LinkingError` are now `#[non_exhaustive]`.
34-
- `Trap` variant discriminants changed; do not rely on casting variants to integers.
3535
- `HostFunction::new`, `HostFunction::func`, and `HostFunction::typed` now require `&mut Store`, and `Imports::link_module` now takes a `ModuleInstance` instead of a raw module instance id.
3636
- Cargo features were renamed from `tinywasm-parser` to `parser` and from `logging` to `log`.
3737
- `Error::ParseError` was renamed to `Error::Parser`, and `Error::Twasm` was added.
3838
- `FuncHandle` and `FuncHandleTyped` were renamed to `Function` and `FunctionTyped`, and module export lookups moved from `exported_*` to `func_untyped`, `func`, and `memory`.
39-
- The `twasm` archive format is now postcard-based and backwards-incompatible with previous versions (thanks [@dragonnn](https://github.com/dragonnn)).
39+
- The `twasm` archive format is now based on postcard (backwards-incompatible with previous versions) (thanks [@dragonnn](https://github.com/dragonnn)).
4040
- The interpreter was refactored around more superinstruction fusion, lower-overhead dispatch, typed-stack locals, jump-oriented lowering, and optional parallel parsing.
4141

4242
### Removed
@@ -51,7 +51,7 @@ This release is a major runtime and API rework. It adds support for several newe
5151
### Fixed
5252

5353
- Fixed archive **no_std** support, which was broken in the previous release, and added tests to ensure it stays working.
54-
- `ModuleInstance::memory` and `FuncContext::memory` are now actually immutable ([#41](https://github.com/explodingcamera/tinywasm/pull/41)).
54+
- `ModuleInstance::memory` and `FuncContext::memory` now take a non-mut reference to self ([#41](https://github.com/explodingcamera/tinywasm/pull/41)).
5555
- Untyped host functions now check return values correctly ([#27](https://github.com/explodingcamera/tinywasm/pull/27)) by [@WhaleKit](https://github.com/WhaleKit).
5656
- `MemoryRefMut::copy_within(src, dst, len)` now follows its documented argument order.
5757
- Imported tables created with `Extern::table(ty, init)` now honor the provided init value.
@@ -63,7 +63,7 @@ This release is a major runtime and API rework. It adds support for several newe
6363
- Rename the cargo features `tinywasm-parser` to `parser` and `logging` to `log`.
6464
- Rename `FuncHandle` to `Function` and `FuncHandleTyped` to `FunctionTyped`.
6565
- Rename module export lookups from `exported_*` methods to `func`, `func_untyped`, and `memory`.
66-
- Regenerate any persisted `twasm` archives; the format is now postcard-based and not backwards compatible with earlier releases.
66+
- Regenerate any pre-existing `twasm` archives, the format is not backwards compatible with earlier releases.
6767

6868
## [0.8.0] - 2024-08-29
6969

Cargo.lock

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

Cargo.toml

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

66
[workspace.dependencies]
7-
tinywasm-parser={version="0.9.0-alpha.1", path="crates/parser", default-features=false}
8-
tinywasm-types={version="0.9.0-alpha.1", path="crates/types", default-features=false}
9-
tinywasm-cli={version="0.9.0-alpha.1", path="crates/cli", default-features=false}
10-
tinywasm={version="0.9.0-alpha.1", path="crates/tinywasm", default-features=false}
7+
tinywasm-parser={version="0.9.0", path="crates/parser", default-features=false}
8+
tinywasm-types={version="0.9.0", path="crates/types", default-features=false}
9+
tinywasm-cli={version="0.9.0", path="crates/cli", default-features=false}
10+
tinywasm={version="0.9.0", path="crates/tinywasm", default-features=false}
1111

1212
criterion={version="0.8", default-features=false, features=["cargo_bench_support", "rayon"]}
1313
eyre="0.6"
@@ -23,7 +23,7 @@ wast="248"
2323
wat="1.248"
2424

2525
[workspace.package]
26-
version="0.9.0-alpha.1"
26+
version="0.9.0"
2727
rust-version="1.95"
2828
edition="2024"
2929
license="MIT OR Apache-2.0"

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
> [!Important]
2-
> The `next` branch contains a major rework of the runtime and API, which is still in development. The latest released version of tinywasm (0.8.0) is not recommended for use anymore, and the API will change significantly before the next release.
3-
41
# <b>`tinywasm`</b>
52

63
[![docs.rs](https://img.shields.io/docsrs/tinywasm?logo=rust&style=flat-square)](https://docs.rs/tinywasm) [![Crates.io](https://img.shields.io/crates/v/tinywasm.svg?logo=rust&style=flat-square)](https://crates.io/crates/tinywasm) [![Crates.io](https://img.shields.io/crates/l/tinywasm.svg?style=flat-square)](./LICENSE-APACHE)
@@ -15,7 +12,7 @@
1512

1613
```toml
1714
[dependencies]
18-
tinywasm = "0.9.0-alpha.0"
15+
tinywasm = "0.9"
1916
```
2017

2118
## Usage

crates/cli/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The crate also exposes reusable helpers such as `tinywasm_cli::wast_runner::Wast
88
## Usage
99

1010
```bash
11-
$ cargo install tinywasm-cli --version 0.9.0-alpha.0 --bin tinywasm
11+
$ cargo install tinywasm-cli --version 0.9.0 --bin tinywasm
1212
$ tinywasm --help
1313
$ tinywasm ./module.wasm
1414
$ tinywasm run --invoke add ./module.wasm 1 2

crates/tinywasm/src/func.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ impl<'store> FuncExecution<'store> {
347347
/// Resume execution with up to `fuel` units of fuel.
348348
///
349349
/// Fuel is accounted in chunks, so execution may overshoot the requested
350-
/// fuel before returning [`ExecProgress::Suspended`].
350+
/// fuel before returning [`ExecProgress::Suspended`] (currently the chunk size is 128 instructions between fuel checks, but this may change in the future).
351351
///
352352
/// Returns [`ExecProgress::Suspended`] when fuel is exhausted, or
353353
/// [`ExecProgress::Completed`] with the final values once the invocation
@@ -381,7 +381,7 @@ impl<'store> FuncExecution<'store> {
381381
/// Resume execution for at most `time_budget` wall-clock time.
382382
///
383383
/// Time is checked periodically, so execution may overshoot the requested
384-
/// time budget before returning [`ExecProgress::Suspended`].
384+
/// time budget before returning [`ExecProgress::Suspended`] (currently time is checked every 128 instructions, but this may change in the future).
385385
///
386386
/// Returns [`ExecProgress::Suspended`] when the budget is exhausted, or
387387
/// [`ExecProgress::Completed`] with the final values once the invocation

crates/tinywasm/src/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,17 @@
5151
//! let wasm = include_bytes!("../../../examples/wasm/add.wasm");
5252
//! let module = tinywasm::parse_bytes(wasm)?;
5353
//!
54-
//! // Create a new store
54+
//! // # Create a new store
5555
//! // Stores are used to allocate objects like functions and globals
5656
//! let mut store = Store::default();
5757
//!
58-
//! // Instantiate the module
58+
//! // # Instantiate the module
5959
//! // This will allocate the module and its globals into the store
6060
//! // and execute the module's start function.
61-
//! // Every ModuleInstance has its own ID space for functions, globals, etc.
6261
//! let instance = ModuleInstance::instantiate(&mut store, &module, None)?;
6362
//!
64-
//! // Get a typed handle to the exported "add" function
65-
//! // Alternatively, you can use `instance.func` to get an untyped handle
63+
//! // # Get a typed handle to the exported "add" function
64+
//! // Alternatively, you can use `instance.func_untyped` to get an untyped handle
6665
//! // that takes and returns [`WasmValue`]s
6766
//! let func = instance.func::<(i32, i32), i32>(&mut store, "add")?;
6867
//! let res = func.call(&mut store, (1, 2))?;

crates/tinywasm/src/store/memory/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ mod vec_memory;
1919
pub(crate) use instance::MemoryInstance;
2020
pub use {lazy::LazyLinearMemory, paged::PagedMemory, vec_memory::VecMemory};
2121

22-
/// Backend storage for a linear memory.
22+
/// Backend storage for a linear memory
23+
///
24+
/// This is a low-level trait that abstracts over the actual storage mechanism for linear memory.
25+
/// This will probably change in the future to allow more efficient implementations.
26+
/// See [`MemoryBackend`] for a higher-level interface to configuring memory storage.
2327
pub trait LinearMemory {
2428
/// Returns the current memory length in bytes.
2529
fn len(&self) -> usize;

0 commit comments

Comments
 (0)