Swift for Wasm July 2026 Updates

Notable changes this month: work on an Emscripten-hosted Swift toolchain; IRGen gained a fix for async typed throws miscompiles on wasm32; WasmKit implemented the Relaxed SIMD and extended-const proposals along with shared linear memory, and now supports Embedded Swift in its core engine, with an example running on an ESP32-C6; JavaScriptKit 0.56.1 fixed the Embedded Swift event loop; and ElementaryUI released 0.4.1, 0.5.0 with SVG support, and 0.6.0 focused on binary size optimizations. Two Swift web frameworks were announced on the forums.

Many thanks to @kateinoigakukun, @krodak, @owenv, @sliemeobn, @wfltaylor for contributions!

Forum Discussions

Swift Toolchain

Work on main split between cross-building the compiler for an Emscripten host, which also required making immediate mode optional and the compiler's data structures 32-bit-safe, and target-side fixes for async typed throws on wasm32 and Embedded key paths.

  • Add CMake for Emscripten-hosted compiler swift#90334;
  • Add build-script products for Emscripten-hosted toolchain swift#90337;
  • Make immediate mode (-interpret) an optional build feature swift#90329;
  • Fix Emscripten libc module under C++ interop, add UUID support swift#90332;
  • Make the compiler's data structures 32-bit-safe swift#90326;
  • IRGen: fix async typed throws miscompiles on Wasm swift#89715;
  • Emscripten host: fix path leaks swift#90760;
  • Fix Emscripten build regressions swift#90601;
  • Fix Emscripten build and Wasm test suite issues swift#90801;
  • Embedded: skip the key path non-public property check in SILVerifier swift#91059;
  • Use object libraries in place of relocatable objects for WebAssembly swift-build#1554;

JavaScriptKit

0.56.1 fixes JavaScriptEventLoop for Embedded Swift on development toolchain snapshots, where clock.enqueue is no longer available and Embedded Swift has neither ContinuousClock nor SuspendingClock to fall back on. On main, @JSFunction gained JS-snippet imports through from: .module(...), so JS code can be shipped as the source of an import, alongside a few BridgeJS fixes:

  • Fix JavaScriptEventLoop for Embedded Swift in main toolchain snapshots #784;
  • Add JS-snippet support using from: .module("/path/to/js-module.js") syntax #792;
  • BridgeJS: fix issues exporting nested types #783;
  • BridgeJS: unify optional stack encoding to presence-flag form #786;
  • BridgeJS: fix syntax error in generated JS #789;
  • BridgeJS: fix argument order for stack-lowered imported parameters #794;

WasmKit

0.3.1 is a bug-fix release for compatibility with current swift-system versions. On main two more proposals were implemented, Relaxed SIMD and extended-const, and shared linear memory from the threads proposal now works on macOS and Linux. Embedded Swift support also landed: optional pieces sit behind package traits, and the core engine now runs on an ESP32-C6. On the Component Model front, WITExtractor was reimplemented on SwiftSyntax to improve SwiftBuild support.

  • Add Relaxed SIMD proposal implementation #373;
  • Support extended-const arithmetic in constant expressions #371;
  • Add shared memory support for mprotect-able platforms #380;
  • Add MultiThread trait and PlatformMutex wrapper #390;
  • WasmParser: add FileSystem trait to allow omitting file system helpers #369;
  • Move StatsCollector behind an EngineStats package trait #388;
  • Make _CWasmKit headers portable to non-Clang compilers #389;
  • Add a wat2wasm example compatible with Embedded Swift #273;
  • SwiftSyntax-based WITExtractor re-implementation #381;
  • Defensive WIT overlay symbols qualification #384;
  • Debugger: fix step-into for calls with arguments, add qWasmGlobal #385;
  • Move byte-stream offset control out of the I/O sources #379;
  • Upgrade swift-system dependency version #376;
  • Add printable core types and a typed Trap kind in WasmKitError #391;
  • Remove ImportError and restrict ResourceLimiter to class types #393;
  • Replace EntityHandle @dynamicMemberLookup with explicit accessors #394;
  • Support Embedded Swift in the core engine #395;
  • Add an ESP32 example with a portable smoke test #396;
  • Add --argv0 and --dir host::guest mapping to wasmkit run #392;
  • Drop the swift-system dependency from WasmParser and WasmKit #397;

ElementaryUI

Three releases: 0.4.1 upgrades to JavaScriptKit 0.56, 0.5.0 adds dynamic SVG views, and 0.6.0 with binary size improvements. As with earlier releases, 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.56 #111;
  • Add support for SVG #112;
  • More strippable FLIP and transition handling #114;
  • Various size and speed optimizations #115;
  • Leaner transition system #116;
  • Improved code size #117;
  • Fix size regression #118;

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:

20 Likes