Swift for WebAssembly
summary
Swift compiles to WebAssembly using the SwiftWasm toolchain and Carton to bundle modules, with JavaScriptKit for DOM interop and Wasmer or wasm‑kit for WASI runtime support. GoodNotes reuses about 100,000 lines of Swift via SwiftWasm; typical debug binaries hit 10–20 MB and the toolchain download is ~2 GB. Build modes: executables export _start, libraries export functions or use @Export/@Extern with C calling convention; WebAssembly 2’s component model promises higher‑level types and simpler interop.
AI-written summary · about
chapters (10)
- 0:00Introduction to Swift for WebAssembly
- 8:17Hello World with Carton
- 12:33Manual WebAssembly compilation
- 19:47Building a WebAssembly library
- 24:20Exporting functions to JavaScript
- 27:28Importing JavaScript into Swift
- 29:24Interactive Connect 4 demo
- 34:47Reusing Swift across platforms
- 35:09Lessons learned from demos
- 39:01Conclusion and future outlook
related talks
36mSwift for WebAssembly
55mSwift for WebAssembly - How To Use Swift In Your Web App
55mSwift for WebAssembly - How To Use Swift In Your Web App
20mThe Journey of Swift's WebAssembly Support
32mIntroduction to WebAssembly for Swift Developers
53mWebAssembly – To the browser and beyond!
14mWebAssembly becoming the biggest platform
25mFast future with WebAssembly
