Swift for WebAssembly
summary
Shows how to compile Swift to WebAssembly using the SwiftWasm toolchain and Carton, interoperate with JavaScript via JavaScriptKit, and run modules in Wasmer or MicroWASI. Demonstrates a reactor vs command model and exporting/importing functions with C calling convention, a multiplayer demo syncing multiple wasm clients with a Vapor websocket back end, and practical notes: GoodNotes reused ~100,000 lines of Swift, binaries hit ~60 MB, and using Swift SDKs and Carton versus manual builds changes workflow and tooling.
AI-written summary · about
chapters (12)
- 0:00Introduction and background
- 2:40What is WebAssembly
- 4:06WebAssembly use cases for Swift
- 6:56SwiftWasm project overview
- 8:21Basic demo with Carton
- 13:23Building without Carton
- 17:21WebAssembly commands vs reactors
- 20:33Reactor demo with die roll
- 24:26Exporting custom Swift functions
- 26:52Importing JavaScript functions
- 28:37Interactive Connect 4 demo
- 31:31Lessons learned and conclusion
related talks
55mSwift for WebAssembly - How To Use Swift In Your Web App
55mSwift for WebAssembly - How To Use Swift In Your Web App
41mSwift for WebAssembly
20mThe Journey of Swift's WebAssembly Support
32mIntroduction to WebAssembly for Swift Developers
49mWasmer Things: An Upside-Down Guide to WebAssembly
50mWeb Assembly
22mThe state of WebAssembly
