Skip to content

Add wat2wasm example compatible with Embedded Swift#273

Draft
MaxDesiatov wants to merge 7 commits into
mainfrom
maxd/embedded-wat2wasm
Draft

Add wat2wasm example compatible with Embedded Swift#273
MaxDesiatov wants to merge 7 commits into
mainfrom
maxd/embedded-wat2wasm

Conversation

@MaxDesiatov
Copy link
Copy Markdown
Member

@MaxDesiatov MaxDesiatov commented Jan 18, 2026

This is an example which demonstrates use of some (but not all) modules of WasmKit in Embedded Swift context.

MaxDesiatov added a commit that referenced this pull request Jan 18, 2026
Both `Stream` and `StreamError` are over-generalization of generic streams, while only `ByteStream` is actually used in `WasmParser`, and `StreamError` is always used with `UInt8` type parameter.

Let's clean these up as unused, `WasmParser` is not in the business of providing general stream APIs.

`StreamError` is now merged with `WasmParserError`, which simplifies future adoption of typed throws to unblock #273.

While we're at it, `ByteStream` now conforms to `~Copyable`, but ideally we'd want it to return `Span<UInt8>` and not `ArraySlice` from its methods. Bumping required Swift version to 6.2 is required for that, which we're not ready to do just yet, so `~Escapable` constraint is not added in this PR.
@MaxDesiatov MaxDesiatov changed the base branch from main to maxd/universal-wasm-parser-error February 25, 2026 12:40
MaxDesiatov added a commit that referenced this pull request Apr 13, 2026
The main reason for using single array type is that combining error types from different visitor types is impractical in certain functions that combine those visitors, and probably also detrimental for code size and performance.

Fortunately, existing error types fit well within the unified type, so mostly it's a text replacement to use `WasmKitError` everywhere.

Unblocks #295 and #273.
Base automatically changed from maxd/universal-wasm-parser-error to main April 13, 2026 16:57
@MaxDesiatov MaxDesiatov force-pushed the maxd/embedded-wat2wasm branch from bda9e5a to 67d4181 Compare May 19, 2026 15:38
@MaxDesiatov MaxDesiatov force-pushed the maxd/embedded-wat2wasm branch from 37500ae to 5faeda2 Compare May 19, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant