All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Support for the typed function references, garbage collection, exception handling, and compact import section proposals.
ResourceLimitercallbacks for memory and table allocation or growth- A default
validateCargo feature & parser option to skip wasm validation - Optional parse-time operand deduplication to reduce
.twasmarchive size - Optional
sendsupport for moving stores and store-local handles across threads - Optional portable atomic shared pointers and counters for targets without native compare-and-swap
- Optional
nightly-tail-callsbackend using Rust's unstable explicit tail calls for interpreter dispatch
- Typed functions now support tuples up to arity 20 and
[u8; 16]values forv128. - Module types now use one recursive type space. Runtime function types are available through
Function::ty(&Store). - Linear memory now uses contiguous
Vec-backed storage. - The minimum supported Rust version increased from 1.95 to 1.98.
- The internal instruction represetaions size was reduced from 16 to 8 bytes.
- Instantiation now rejects directly defined imports that contain handles from another
Store. - Tail calls to host functions now return directly to the caller frame.
- Memory64 bulk-memory operations and optimized stores now use the correct value-stack lanes.
memory.initnow performs correct bounds checks and operand lowering.- Memory64 now uses the correct default limits and host-size conversions, including on 32-bit targets.
Function::callandFunction::call_resumablenow write to caller-provided result slices. Untyped host callbacks also receive a result slice and returnResult<()>.- Creating a
HostFunctionno longer requires aStore. Definitions requireSend + Syncand can be reused across stores. Module instantiation now borrowsImportsso the same imports can also be reused. HostFunction::tyandWasmFunction::tywere removed. UseFunction::ty(&Store)for runtime types.- Function and managed reference handles are tied to their originating
Store. Managed references keep their referents live, soWasmValueis no longerCopy. Nullable typed references useOption<T>, while bare typed references are non-null. - The
Memory,Table,Global, andTagconstructors were renamed fromnewtotry_new. Store::idnow returnsu32, andModuleInstanceAddrwas renamed toModuleInstanceId.- Element types now use
RefType, and module definitions useTableDefinition { ty, init }.Table::grownow returnsResult<Option<usize>>, matchingMemory::grow. Parser::newnow takesParserOptions. UseParser::default()for default settings.Parser::with_optionswas removed.- Pluggable memory backends and
Config::with_trap_on_oomwere removed for performance reasons. Linear memory is alwaysVec-backed. UseResourceLimiterto allow, reject, or trap memory allocation and growth requests. WasmTupleChainwas removed. Use direct tuples up to arity 20 or untyped functions for larger signatures.ToWasmTypeswas renamed toWasmTypes, andToWasmTypewas renamed toWasmValueType. Conversion traits now includeWasmTypes, andFromWasmValues::from_wasm_valuesrejects unconsumed values directly.- The
.twasmformat changed. Regenerate archives created by earlier TinyWasm versions.
All Commits: https://github.com/explodingcamera/tinywasm/compare/v0.9.1...v0.10.0
- Added
ParserOptions::validationto optionally skip wasmparser validation.
- Improved parser, lazy-memory, and interpreter performance.
- Fixed addressing and operand widths for 64-bit tables.
- Fixed branch stack shaping that could corrupt execution or panic (fixes #47).
- The embedding API's
instantiate/start/start_funcno longer fall back to_startif the module has no start section. The CLI still uses_startas its default entry point (fixes #46). - Removed the parser's
optimize_remove_nopoption and accessors. - Changed public
Instructionvariants and the.twasmformat. Existing archives must be regenerated. TableTypelimits now useu64. UseTableType::neworTableType::new64instead of struct literals.ToWasmTypesnow uses an associated constant, andwasm_typesreturnsCow.LinearMemorynow uses a singleusizeaddress and changed its fixed-width read/write signatures.
All Commits: https://github.com/explodingcamera/tinywasm/compare/v0.9.0...v0.9.1
- Added blocking reentrant Wasm calls from host functions through
FuncContext::callandFuncContext::call_untyped.
- Direct
Function::callandFunction::call_resumablecalls during an active invocation now trap instead of corrupting the active call/value stacks. While this is technically a breaking change, it prevents stack corruption and is a necessary safety fix. UseFuncContext::callorFuncContext::call_untypedfor reentrant calls instead.
All Commits: https://github.com/explodingcamera/tinywasm/compare/v0.8.0...v0.9.0
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.
- Support for the
custom_page_sizesproposal (#22 by @danielstuart14) - Support for the
tail_call,memory64,simd,relaxed_simd,wide_arithmetic, andextended_constproposals (#37, #38, #39) - New
EngineAPI (tinywasm::Engineandengine::Config) for runtime configuration - Resumable execution APIs:
call_resumable,resume_with_fuel,resume_with_time_budget, andExecProgress - Host-function fuel APIs:
FuncContext::charge_fuelandFuncContext::remaining_fuel engine::Configsupport for fuel policy, stack sizing, memory backend selection, and trap-on-OOM behavior- New feature flags:
canonicalize-nans,simd-x86,guest-debug,debug, andparallel-parser - Top-level parser re-exports behind the
parserfeature:parse_bytes,parse_file, andparse_stream - Completely new
tinywasmcli
Store::newnow takes anEngine, useStore::default()for default settings.ModuleInstance::funcnow validates exact Wasm signatures at lookup time and fails immediately on mismatches.- Stack and call-stack limits can now be defined with
engine::Config - Module-internal by-index inspection APIs are now gated behind
guest-debug Debugimplementations are now gated behinddebug.- MSRV increased to 1.95 and the crate now uses Rust 2024.
Error,Trap, andLinkingErrorare now#[non_exhaustive].HostFunction::new,HostFunction::func, andHostFunction::typednow require&mut Store, andImports::link_modulenow takes aModuleInstanceinstead of a raw module instance id.- Cargo features were renamed from
tinywasm-parsertoparserand fromloggingtolog. Error::ParseErrorwas renamed toError::Parser, andError::Twasmwas added.FuncHandleandFuncHandleTypedwere renamed toFunctionandFunctionTyped, and module export lookups moved fromexported_*tofunc_untyped,func, andmemory.- The
twasmarchive format is now based on postcard (backwards-incompatible with previous versions) (thanks @dragonnn). - The interpreter was refactored around more superinstruction fusion, lower-overhead dispatch, typed-stack locals, jump-oriented lowering, and optional parallel parsing.
- Cargo feature
simdwas removed. RefNullwas removed and replaced withFuncRefandExternRef.tinywasm::interpreteris no longer a public module.InterpreterRuntimeandTinyWasmValueare no longer public API.FuncHandle::namewas removed.- Mutable
ModuleInstanceexport lookup variantsmemory_mut,table_mut,global_mut, andextern_item_mutwere removed.
- Fixed archive no_std support, which was broken in the previous release, and added tests to ensure it stays working.
ModuleInstance::memoryandFuncContext::memorynow take a non-mut reference to self (#41).- Untyped host functions now check return values correctly (#27) by @WhaleKit.
MemoryRefMut::copy_within(src, dst, len)now follows its documented argument order.- Imported tables created with
Extern::table(ty, init)now honor the provided init value. - Fixed unchecked memory offsets causing issues on 32-bit platforms.
- Replace
Store::new()withStore::default()for default settings, orStore::new(Engine::new(config))for custom runtime configuration. - Rename the cargo features
tinywasm-parsertoparserandloggingtolog. - Rename
FuncHandletoFunctionandFuncHandleTypedtoFunctionTyped. - Rename module export lookups from
exported_*methods tofunc,func_untyped, andmemory. - Regenerate any pre-existing
twasmarchives, the format is not backwards compatible with earlier releases.
All Commits: https://github.com/explodingcamera/tinywasm/compare/v0.7.0...v0.8.0
- Full support for Multi-Memory proposal
- Improved support for WebAssembly 2.0 features
- Extern tables now correctly update their type after growing
- Increased MSRV to 1.80.0
- Simplify and optimize the interpreter loop
- Use a separate stack and locals for 32, 64 and 128 bit values and references (#21)
- Updated to latest
wasmparserversion - Removed benchmarks comparing TinyWasm to other WebAssembly runtimes to reduce build dependencies
- Memory and Data Instances are no longer reference counted
All Commits: https://github.com/explodingcamera/tinywasm/compare/v0.6.0...v0.7.0
- Remove all unsafe code
- Refactor interpreter loop
- Optimize Call-frames
- Remove unnecessary reference counter data from store
All Commits: https://github.com/explodingcamera/tinywasm/compare/v0.6.0...v0.6.1
- Switched back to the original
wasmparsercrate, which recently added support forno_std - Performance improvements
- Updated dependencies
All Commits: https://github.com/explodingcamera/tinywasm/compare/v0.5.0...v0.6.0
ImportsandModuleare now cloneable (#9)
- Improved documentation and added more tests
- Tests can now be run on more targets (#11)
- Nightly version has been updated to fix broken builds in some cases (#12)
- Add
aarch64-apple-darwinandarmv7-unknown-linux-gnueabihftargets to CI (#12)
- Removed the
EndFuncinstruction, as it was already covered by theReturninstruction
This also fixes a weird bug that only occurred on certain nightly versions of Rust
All Commits: https://github.com/explodingcamera/tinywasm/compare/v0.4.0...v0.5.0
- Added this
CHANGELOG.mdfile to the project - Added merged instructions for improved performance and reduced bytecode size
- Now using a custom
wasmparserfork - Switched to a visitor pattern for parsing WebAssembly modules
- Reduced the overhead of control flow instructions
- Reduced the size of bytecode instructions
- Fixed issues on the latest nightly Rust compiler
- Simplified a lot of the internal macros
- Removed duplicate internal code
All Commits: https://github.com/explodingcamera/tinywasm/compare/v0.3.0...v0.4.0
- Added benchmarks for comparison with other WebAssembly runtimes
- Added support for pre-processing WebAssembly modules into tinywasm bytecode
- Improved examples and documentation
- Implemented the bulk memory operations proposal
- Overall performance improvements
All Commits: https://github.com/explodingcamera/tinywasm/compare/v0.2.0...v0.3.0
- Better trap handling
- Implement linker
- Element instantiation
- Table Operations
- FuncRefs
- Typesafe host functions
- Host function context
- Spec compliance improvements
- Wasm 2.0 testsuite
- Usage examples
- End-to-end tests
- Lots of bug fixes
- Full
no_stdsupport
All Commits: https://github.com/explodingcamera/tinywasm/compare/v0.1.0...v0.2.0
- Support for
br_table - Memory trapping improvements
- Implicit function label scopes
- else Instructions
- All Memory instructions
- Imports
- Basic linking
- Globals
- Fix function addr resolution
- Reference Instructions