I'm excited to share an update on the latest progress in the Swift for WebAssembly ecosystem! Last two months of community's work were mainly focused on polishing the Swift toolchain, developing new features in our primary packages (namely JavaScriptKit and WasmKit), while also porting existing Swift libraries to Wasm.
Here’s a list of notable changes prepared with help from @kateinoigakukun, @krodak, and @scottm:
Swift Toolchain
- Fixed SwiftPM passing incorrect CLI arguments to WasmKit when running
swift testwith Wasm Swift SDK; - Updated Swift toolchain
docs/WebAssembly.mdinstructions for local builds of Wasm Swift SDK with a development toolchain; - Updated "Getting Started with Wasm" page on swift.org for 6.2 release;
- Significant linker memory footprint and link time reduction: #84784;
@_expose(wasm)serialization crash fix cherry-picked for future 6.2 patch releases;import WASILibcsupport for Embedded Swift cherry-picked for 6.2.1 patch release;swift-cmark(a dependency ofswift-markdown,swift-docc, andswift-format) had WASI build support cherry-picked for 6.2 branch, also included in the 0.7.1 SemVer tag;- Checks for
swift runcommand with Wasm Swift SDK inswift-integration-tests.
JavaScriptKit
Most of the changes were made in the BridgeJS plugin improving interoperability between Swift and JavaScript/TypeScript:
New Features:
- Added Swift -> JS
protocolsupport #460 #456; - Added Swift -> JS default parameter value support #453;
- Added Swift -> JS
static/classproperties & functions support #448; - Added Swift -> JS
Optionalsupport #444;
Improvements / Fixes:
- Migrated to code fragment printer #442;
- Switched to direct
TypeSyntaxinitializer #445; - Fixed nested type resolution for
MemberTypeSyntax#433;
WasmKit
One of our goals for WasmKit is to enable first-class Swift for Wasm debugging support when using LLDB. This is still early days, but we had some significant progress:
- Added GDB Remote Protocol support with LLDB extensions;
- Added
breakpointinstruction to internal WasmKit VM bytecode; - Implemented
qWasmCallStackdebugger host command and basic breakpoints support; - Implemented basic instruction stepping support in the debugger.
- Added
--debugger-portCLI option towasmkit runcommand whenWasmDebuggingSupportpackage trait is enabled.
Some other relevant small improvements worth mentioning:
- Implemented parsing of atomic load/store instructions from the WebAssembly multi-threading proposal;
- Clarified required Swift version, list of supported platforms, and SwiftPM package usage instructions in
README.md; - Added broader CI matrix for building and testing on Android, covering Swift 6.2 and
maindevelopment snapshots. - Enabled Swift 6 mode and fixed all remaining Swift Concurrency warnings;
- If you ever wanted to put a Wasm runtime into your Wasm runtime (e.g. for developer tooling or for implementing Wasm feature compatibility shims), WasmKit Wasm runtime now can be built for WASI and can run nested in a separate Wasm runtime;
- WasmKit successfully builds on CI with SwiftPM on Swift Build when using
maindevelopment snapshots.
Other Projects
- DispatchAsync – New community workaround for compiling Swift that uses
import Dispatchto Wasm. ProvidesDispatchQueue,DispatchGroup,DispatchSemaphore,DispatchTime, andDispatchTimeIntervalas a drop-in replacement for Dispatch, implemented using Swift Concurrency; - swift-distributed-tracing – Introduced CI checks for WebAssembly compilation #175. Compilation fixes were merged previously in #174;
- WebKit – Added WebAssembly debugging support via Remote Web Inspector.
Improvements prior to September 2025
There were a few notable improvements made that didn't end up included in the previous Q3 update, listed below for completeness:
- GraphQLSwift/DataLoader – Enabled Wasm compilation #23, and integrated Wasm builds into CI #26;
- vapor/sql-kit – Enabled Wasm compilation #190;
- vapor/ci added Wasm CI build support to Vapor #54;
- JavaScriptKit – Added Swift -> JS case / raw / namespacing / associated value
enums support #436 #418 #455; - JavaScriptKit – Macro extension to define JS namespace #405;
Thank you for reading, and please feel free to add any comments or suggestions if we missed anything!