Notable changes this month: the Swift.org blog covered how Goodnotes shipped its app to the web with Swift and WebAssembly; Emscripten support improved in the Swift compiler, the standard library, and the test suite; JavaScriptKit shipped multiple releases (0.54.0–0.56.0) with substantial BridgeJS work; WasmKit 0.3.0 released, bringing initial Component Model support with three new Wasm proposals (SIMD, Atomics, Exception Handling); and ElementaryUI reached 0.4.0.
Many thanks to @etcwilde, @jackguac, @kateinoigakukun, @krodak, @sliemeobn, @wfltaylor for contributions!
Blog Posts
- Bringing Goodnotes to the Web with Swift and WebAssembly: Yuta Saito (@kateinoigakukun) explains how Goodnotes compiled its shared Swift code to WebAssembly with SwiftWasm, using JavaScriptKit for bidirectional Swift-JavaScript interop and WASI threads for high performance.
Forum Discussions
- Wasm WebGPU State Machine Engine: SwiftXState, an early-stage state-machine engine with a WebGPU proof-of-concept running Swift in the browser via Wasm.
Swift Toolchain
On main, toolchain work this month mostly focused on improvements to Emscripten support:
utils/build-script: extract Wasm helpers from WASI-only products swift#89549;wasistdlib.py: addSILOptimizerto lit test paths swift#89420;- CMake: add Emscripten build system configuration swift#89768;
wasiswiftsdk: put the toolchain version into the Swift SDK bundle name swift#89841;- Synchronization: use busywait when wasi-libc opts into busywait mode swift#89829;
- Enable the lit test suite for
wasm32-unknown-emscriptenswift#89806; - stdlib: add an
EmscriptenLibcoverlay swift#89797; - Split ELF and Wasm Swift runtime registration files swift#89930;
- stdlib: add necessary
EmscriptenLibcconditions swift#89799; - Embedded: fix concurrency dynamic-isolation linker errors swift#87877;
- Add tests for
swiftasyncctail calls on Wasm swift#88074; - Enable Emscripten in
LocalTestingDistributedActorSystem.swiftswift#87797;
JavaScriptKit
The most notable additions, landing across the 0.54.0–0.56.0 releases, were BridgeJS support for associated-value and case enums, throwing/async closures, and Swift doc comments carried through to the generated .d.ts.
- Change
Data.construct(from uint8Array:)return type fromData?toData#752; - BridgeJS: support optional
@JSstruct in imported function signatures #755; - BridgeJS: support case enums as imported function parameters and returns #756;
- BridgeJS: use a
BigIntzero placeholder for Wasm i64 in generated JS #757; - BridgeJS: support non-
ConvertibleToJSValueasync exported return types #758; - BridgeJS: support optional
@JSClassas exported function parameters #754; - Fix error descriptions for Embedded Swift compatibility #759;
- BridgeJS: fix reject path of zero-parameter async throwing exports #760;
- BridgeJS: support associated-value enums in import and async paths #764;
- BridgeJS: support
throwsandasyncfor closures #766; - BridgeJS: normalize Wasm pointer offsets in JS #768;
- BridgeJS: emit static members in
declare globalclass declarations #772; - BridgeJS: include Swift doc comments in generated
.d.ts#771; - BridgeJS: export types using a separate JS representation #750;
WasmKit
WasmKit 0.3.0 shipped with initial WebAssembly Component Model support behind a non-default ComponentModel package trait (a binary parser/encoder, ComponentInstance/ComponentLoader, and CLI invocation of simple components with WAVE-encoded arguments); three new core-Wasm proposals (Fixed-Width SIMD, Atomics, and Exception Handling); substantially expanded WASIp1 coverage (poll_oneoff timers, an in-memory file system, thread-safety, and fd-leak/IO fixes); and a move to typed throws via a unified WasmKitError coinciding with the minimum supported Swift version raised to 6.3.
Notable changes merged in June:
- Add support for the WebAssembly Exception Handling proposal #311;
- Represent Component Model valtypes as type index or inline primitive #353;
- Make
WASIBridgeToHostthread-safe #347; - Per-node locking for the in-memory WASI file system #358;
- Make
InstructionTranslatornon-copyable #209; SystemExtras: stop shadowing the Cstattype (fixes build with swift-system 1.7.0) #349;- Add
Sendableconformance toCatchClauseandTryCatch#355;
ElementaryUI
Version 0.4.0 released, upgrading to JavaScriptKit 0.55 and broadening the swift-collections dependency version range. As with 0.3.0, existing projects need to reinstall the bundled BrowserRuntime npm package and clear the Vite dev cache (see the release notes for the exact commands).
- Upgrade to JavaScriptKit 0.55 #108;
- Unpin
swift-collectionsand bump to 1.6.0 #107; - Fix attributes without values #110;
Thank you for reading, and please feel free to add any comments or suggestions if we missed anything!
If you'd like to catch up with changes from previous months, here's a list of relevant updates: