A Vision for WebAssembly Support in Swift
Swift as a language and ecosystem
- Several commenters praise Swift as ergonomic, productive, and “pleasant Rust,” with advanced features that can be mostly ignored when desired.
- Others argue it’s essentially only compelling on Apple platforms; outside that, Rust, Go, Kotlin, or Dart are seen as safer bets.
- People note Swift can be used as a scripting language (shebang scripts) and easily turned into CLI tools, with access to Apple APIs.
UI frameworks and type system pain
- Strong dislike for SwiftUI is common beyond trivial UIs: fragile previews, inscrutable compiler errors, and difficulty debugging reactive “magic.”
- Many prefer UIKit/AppKit and Interface Builder, or small SwiftUI components only.
- The type checker’s exponential behavior and cryptic “cannot type-check in reasonable time” errors are seen as a core, longstanding flaw affecting SwiftUI and even simple math code.
- Workarounds include aggressively splitting views into tiny structs, adding type annotations, or avoiding complex expressions.
- Some question whether declarative/reactive UI (SwiftUI, Jetpack Compose) is actually better than imperative approaches at scale.
WebAssembly and cross‑platform story
- There’s excitement about first-class WebAssembly/WASI support as a way to make Swift more viable off Apple platforms.
- Skeptics say Swift tools barely handle Apple’s “happy path” and question diverting effort to “yet another wasm platform,” especially when Rust and .NET already have strong WASM stories and Go’s is weak.
- The existing SwiftWasm project is cited as working “pretty great” but still incomplete (WASI preview 1, missing pieces, Apple/Xcode friction).
- Suggestions include better UI stories via bindings (GTK, Qt), SwiftCrossUI, Flutter-like approaches (Shaft), and web-focused frameworks.
Tooling, stability, and governance concerns
- Complaints: slow builds, flaky Swift Package Manager, Xcode showing errors after “successful” builds, broken previews.
- Some feel the language is driven by academic purity (e.g., strict concurrency / Swift 6) at high migration cost with unclear practical benefit.
- Apple’s control and shifting priorities create fear of rug-pulls for non-Apple use; comparisons are made to Google’s and Microsoft’s histories, TensorFlow+Swift, Combine, and somewhat-stalled Async Algorithms.
Comparisons with other languages
- Rust: more complex ownership model but stronger ecosystem beyond Apple; Swift seen as nicer syntax with reference counting as the “normal path.”
- Go: WASM support criticized; language feels minimal to some.
- Dart/Flutter: praised for cross-platform UI and pleasant language, though single-threaded.
- Kotlin (especially KMP) is viewed as Swift’s main cross-platform competitor likely to win by default.
- Some call for real Windows support and even JIT on iOS, though both are seen as unlikely under current Apple policies.