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
- SwiftWeb: full-stack web apps in Swift: a developer preview that renders pages to HTML on the server and ships interactive parts as Wasm client islands, with distributed actors for client-server calls.
- Swiflow, a frontend stack for the web in Swift: another take on a Swift frontend stack targeting Wasm.
- TinyString for Embedded Swift, Wasm, and the world: a small-footprint string type usable where the standard
Stringis too heavy. - Wasm-optimized JSON-parsing library: a Foundation-free parser, reported by its author at 154 KB object size and 1.4x faster than the Foundation parser.
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
JavaScriptEventLoopfor Embedded Swift inmaintoolchain 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
MultiThreadtrait andPlatformMutexwrapper #390; - WasmParser: add
FileSystemtrait to allow omitting file system helpers #369; - Move
StatsCollectorbehind anEngineStatspackage trait #388; - Make
_CWasmKitheaders portable to non-Clang compilers #389; - Add a
wat2wasmexample compatible with Embedded Swift #273; - SwiftSyntax-based
WITExtractorre-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-systemdependency version #376; - Add printable core types and a typed
Trapkind inWasmKitError#391; - Remove
ImportErrorand restrictResourceLimiterto class types #393; - Replace
EntityHandle@dynamicMemberLookupwith explicit accessors #394; - Support Embedded Swift in the core engine #395;
- Add an ESP32 example with a portable smoke test #396;
- Add
--argv0and--dir host::guestmapping towasmkit run#392; - Drop the
swift-systemdependency fromWasmParserandWasmKit#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: