Currently viewing the human version
Switch to AI version

What Actually Changed (And What Broke)

Swift for WebAssembly had a bunch of updates in Q3 2025. Some are great, some will break your CI. Here's what you need to know so you don't spend your weekend debugging build failures.

The Triple Name Change That Broke Everything

Swift renamed wasm32-unknown-wasi to wasm32-unknown-wasip1. If you're using --triple anywhere in your build scripts, CI configs, or deployment tools, it's gonna break with a confusing error about unknown targets.

The rename makes it clear they're using WASI Preview 1, which is fine, but why break existing builds for naming clarity? They're preparing for WASI Preview 2 (wasip2) but that's not here yet.

If you use --swift-sdk instead of --triple, you're fine. If not, time to grep through your entire build system and update everything. Fun weekend project.

Foundation Finally Works (Mostly)

Foundation is now included in Swift SDK for WebAssembly. This is huge because before this, porting Swift apps to WASM meant rewriting all your JSON parsing, HTTP calls, and file handling from scratch.

Embedded Swift still doesn't get Foundation because they're optimizing for tiny binaries. Makes sense but sucks if you need both small size and basic libraries.

I wasted way too much time porting our API client before Foundation support existed. Still fighting some weird compilation issues but at least I didn't have to rewrite the entire thing.

CI That Actually Tests WASM

The swiftlang/github-workflows now has enable_wasm_sdk_build and enable_embedded_wasm_sdk_build flags. Finally, libraries can test WebAssembly compatibility in CI instead of discovering breakage when users complain.

Swift's core libraries are already using this. Good, because nothing's worse than a "works on my machine" library that fails to compile for WASM.

Before this, WASM support was basically "maybe it works, maybe it doesn't, try it and see." Now libraries can catch WASM breakage before shipping.

LLDB Debugging That Doesn't Suck

LLDB now supports WebAssembly debugging upstream. Finally you can set breakpoints and inspect variables instead of adding print() statements everywhere like a fucking caveman.

It'll be in Swift LLVM 21. Debugging WASM won't require guessing what went wrong based on cryptic runtime errors anymore. Same LLDB commands you already know.

Before this, debugging Swift WASM was like debugging with your eyes closed. This is probably the most useful improvement for actually getting work done.

Supporting Libraries Getting Better

WasmKit 0.1.6 added Android support but dropped Swift 5.9. If you're still on 5.9, time to upgrade or get left behind.

JavaScriptKit (0.31-0.35) got a bunch of improvements:

  • Better JSClosure APIs for concurrency that actually work
  • JavaScriptFoundationCompat module for bridging Foundation types
  • Enhanced Embedded Swift support
  • BridgeJS improvements for JS/TypeScript interop

JavaScriptKit was always a bit finicky for complex JS integration. The new versions are much more stable and less likely to crash when you need to do anything beyond basic function calls.

Embedded Concurrency: Finally, Swift Async/Await That Works

I wasted way too much time trying to get Swift's async/await working in WebAssembly. Three months later, after countless "this should work" moments, embedded concurrency actually makes it possible. Finally don't have to choose between Swift's concurrency model and actually shipping to WASM.

Why Regular Swift Concurrency Doesn't Work in WASM

Embedded Swift concurrency fixes the nightmare of getting Swift's actor model working in WebAssembly. Regular Swift concurrency needs a full runtime with thread pools and complex scheduling—exactly the kind of heavyweight shit that makes WASM crash and burn. The Swift concurrency manifesto explains why the standard approach is too heavy for constrained environments.

The implementation works with Swift development snapshots using swift run, but don't expect everything to work. Task.sleep is missing because the team is still figuring out how to make timers work in WASM without breaking everything. The Swift forums track which async functions actually work.

Before this, WebAssembly was basically just for math-heavy kernels. Now you can build actual apps with complex async flows instead of fighting the platform every step of the way.

JavaScript Event Loop Integration That Actually Works

The JavaScriptEventLoop integration is where this gets interesting. Our image editor was stuck in callback hell trying to coordinate GPU work with UI updates. Now Swift async/await talks directly to the browser's event loop without the constant marshaling bullshit. Still fighting some edge cases but way better than before.

What this actually means for your app:

  • DOM events work properly: Click handlers don't freeze the browser while your Swift code runs. MDN's event handling docs explain why this matters.
  • GPU + UI coordination: WebGPU compute shaders can update the UI smoothly instead of stuttering every frame. WebGPU examples show the visual difference.
  • Streaming without blocking: Process large datasets without making the page unresponsive. Streams API integration handles backpressure correctly.
  • Network requests that don't suck: Fetch API calls work with Swift async/await instead of callback hell.

Swift keeps its type safety while talking to JavaScript's event system. No more choosing between safety and actually working with the browser. JavaScriptKit documentation covers the interop details.

Why It's Actually Fast (And When It's Not)

Embedded concurrency in WASM skips most of the performance-killing overhead that makes regular threaded apps slow as shit. No context switching, no thread creation costs, no complex locks. But WebAssembly's linear memory model means you have to think differently about shared state.

The deterministic execution model makes performance more predictable, which is huge for real-time apps. Our audio processing pipeline used to have random stutters from thread scheduling; now it's way more consistent. The WebAssembly performance guide explains why single-threaded can beat multi-threaded.

Debugging Actually Works Now

The debugging integration isn't perfect but it's way better than the nothing we had before. LLDB can see task states and async call stacks without crashing half the time.

Chrome DevTools can set breakpoints in async Swift functions, which used to be impossible. Still buggy as hell but when it works, you can actually trace what's happening in your concurrent code.

Carton is Dead, Use SwiftPM Plugins

Carton was always a hack. The Q3 updates finally give us a real solution with SwiftPM plugins from JavaScriptKit.

swift package js generates ES modules and WASM files directly without external dependencies. Way more reliable for CI/CD since you don't have to mess with Node.js versions and npm's bullshit dependency resolution.

What's Still Broken

Task.sleep and timers are still missing because the team can't figure out how to make them work in WASM without breaking everything. So don't expect any timer-based code to work properly yet.

Threading support is "coming" but who knows when that'll actually land. For now, just don't expect real threading - it's single-threaded concurrency only.

Swift for WebAssembly Q3 2025 Updates FAQ

Q

What does the WASI triple renaming mean for existing projects?

A

Projects using --triple wasm32-unknown-wasi need to update to --triple wasm32-unknown-wasip1. However, if you're using Swift SDK IDs with --swift-sdk, no changes are required. The functionality remains identical—only the naming convention has changed to explicitly indicate WASI Preview 1 support and prepare for future WASI versions.

Q

Is embedded concurrency available in all Swift WebAssembly environments?

A

Embedded concurrency is available for CLI executables built with main development snapshots and browser applications using JavaScriptEventLoop from JavaScriptKit. However, some async stdlib functions like Task.sleep aren't available yet. Full concurrency support varies depending on your deployment target and Swift toolchain version.

Q

Can I use Foundation libraries in Embedded Swift for WebAssembly?

A

No, Foundation isn't supported in Embedded Swift yet, though it's available in standard Swift SDK for WebAssembly. Embedded Swift focuses on minimal resource usage and direct hardware control, while Foundation provides higher-level abstractions that conflict with embedded constraints. Use standard Swift for WebAssembly if you need Foundation support.

Q

How do I migrate from Carton to the new SwiftPM plugin approach?

A

Replace Carton with swift package js plugin from JavaScriptKit. Instead of Carton's development server, create a simple HTML file that imports the generated ES module. Use swift package --swift-sdk [SDK-ID] -c release plugin --allow-writing-to-package-directory js --output ./Bundle for production builds with optimization.

Q

What's the current status of debugging support for Swift WebAssembly?

A

LLDB Web

Assembly support is integrated upstream and will be available in Swift LLVM 21. Chrome DevTools provides enhanced Swift debugging through the WebAssembly DWARF extension. You can set breakpoints, inspect variables, and debug async code directly in the browser or through LLDB command line.

Q

Are there any known performance differences between Carton and the new plugin approach?

A

The new approach may produce larger binary sizes due to ICU data inclusion in recent Foundation versions. Apps that were ~20MB with Carton might be ~50MB with the new approach. Consider using swift-icudata-slim for smaller binary sizes if international features aren't required.

Q

Which Swift libraries now support WebAssembly CI testing?

A

Major libraries including swift-algorithms, swift-async-algorithms, swift-argument-parser, swift-atomics, swift-collections, swift-foundation, swift-crypto, swift-log, swift-nio, swift-numerics, swift-syntax, and swift-system now include WebAssembly CI jobs. This ensures ongoing compatibility and catches breaking changes early.

Q

Can I use the new concurrency features with existing JavaScript frameworks?

A

Yes, embedded concurrency integrates with JavaScript event loops through JavaScriptEventLoop. You can use async/await Swift code that responds to DOM events, coordinates GPU computations, and manages network requests while maintaining interoperability with React, Vue, or other JavaScript frameworks.

Q

What's the difference between standard Swift WebAssembly and Embedded Swift?

A

Standard Swift for WebAssembly includes the full runtime, Foundation support, and complete language features but has larger binary sizes. Embedded Swift targets minimal resource usage with smaller binaries but lacks Foundation support and some runtime features. Choose based on your performance and size requirements.

Q

When will WASI Preview 2 support be available?

A

The triple renaming to wasip1 prepares for WASI Preview 2 (wasip2) support, but no timeline has been announced. WASI Preview 2 will bring improved component model support and enhanced security capabilities. Monitor Swift forums and the WebAssembly working group for updates on Preview 2 standardization and Swift support.

Q

How do I optimize WebAssembly binary sizes with the new tooling?

A

Use release builds with swift package -c release, ensure wasm-opt is installed for automatic optimization, and consider swift-icudata-slim for smaller ICU datasets. The plugin automatically applies wasm-opt if available. Binary sizes increased with Foundation inclusion, but optimization tools can help manage this growth.

Q

Can I use Swift Package Manager dependencies in WebAssembly projects?

A

Yes, SwiftPM dependencies work with Swift WebAssembly projects. The CI integration for major Swift libraries ensures compatibility. However, some packages may require WebAssembly-specific adaptations, particularly those with platform-specific dependencies or unsafe code patterns incompatible with WebAssembly's security model.

Related Tools & Recommendations

compare
Recommended

MetaMask vs Coinbase Wallet vs Trust Wallet vs Ledger Live - Which Won't Screw You Over?

I've Lost Money With 3 of These 4 Wallets - Here's What I Learned

MetaMask
/compare/metamask/coinbase-wallet/trust-wallet/ledger-live/security-architecture-comparison
100%
howto
Recommended

How to Actually Implement Zero Trust Without Losing Your Sanity

A practical guide for engineers who need to deploy Zero Trust architecture in the real world - not marketing fluff

rust
/howto/implement-zero-trust-network-architecture/comprehensive-implementation-guide
57%
compare
Recommended

Zig vs Rust vs Go vs C++ - Which Memory Hell Do You Choose?

I've Debugged Memory Issues in All Four - Here's What Actually Matters

Zig
/compare/zig/rust/go/cpp/memory-management-ecosystem-evolution
57%
news
Recommended

WebAssembly Security Research Highlights JIT Compiler Risks

New paper shows potential attack vectors in WASM runtime optimization

WebAssembly
/news/2025-09-21/webassembly-v8-cve-security-flaw
57%
compare
Recommended

Bun vs Node.js vs Deno: The Developer's Migration Journey in 2025

Which JavaScript runtime won't make you want to quit programming?

Bun
/compare/bun/nodejs/deno/developer-experience-migration-journey
57%
integration
Recommended

Claude API Code Execution Integration - Advanced Tools Guide

Build production-ready applications with Claude's code execution and file processing tools

Claude API
/integration/claude-api-nodejs-express/advanced-tools-integration
57%
compare
Recommended

Bun vs Deno vs Node.js: Which Runtime Won't Ruin Your Weekend

compatible with Bun

Bun
/compare/bun/deno/nodejs/performance-battle
57%
news
Recommended

Google Mete Gemini AI Directamente en Chrome: La Jugada Maestra (o el Comienzo del Fin)

Google integra su AI en el browser más usado del mundo justo después de esquivar el antimonopoly breakup

OpenAI GPT-5-Codex
/es:news/2025-09-19/google-gemini-chrome
57%
news
Recommended

Google integra Gemini AI directamente en Chrome para todos los usuarios - 2025-09-21

El asistente de inteligencia artificial llega como panel lateral gratuito, democratizando el acceso a IA generativa en el navegador más usado del mundo

chrome
/es:news/2025-09-21/google-chrome-gemini-ia
57%
news
Recommended

Chrome DevTools werden immer langsamer

Memory-Usage explodiert bei größeren React Apps

OpenAI GPT-5-Codex
/de:news/2025-09-19/google-gemini-chrome
57%
tool
Recommended

Polygon Edge Enterprise Deployment - The Abandoned Blockchain Framework Guide

Deploy Ethereum-compatible blockchain networks that work until they don't - now with 100% chance of no official support.

Polygon Edge
/tool/polygon-edge/enterprise-deployment
57%
pricing
Recommended

What Edge Computing Actually Costs When You're Not Reading Marketing Materials

The real numbers from September 2025, not the bullshit they put in blog posts

edge
/pricing/cloudflare-aws-vercel/edge-computing-roi-calculator
57%
tool
Popular choice

jQuery - The Library That Won't Die

Explore jQuery's enduring legacy, its impact on web development, and the key changes in jQuery 4.0. Understand its relevance for new projects in 2025.

jQuery
/tool/jquery/overview
52%
tool
Popular choice

Hoppscotch - Open Source API Development Ecosystem

Fast API testing that won't crash every 20 minutes or eat half your RAM sending a GET request.

Hoppscotch
/tool/hoppscotch/overview
50%
tool
Popular choice

Stop Jira from Sucking: Performance Troubleshooting That Works

Frustrated with slow Jira Software? Learn step-by-step performance troubleshooting techniques to identify and fix common issues, optimize your instance, and boo

Jira Software
/tool/jira-software/performance-troubleshooting
48%
compare
Recommended

Python vs JavaScript vs Go vs Rust - Production Reality Check

What Actually Happens When You Ship Code With These Languages

javascript
/compare/python-javascript-go-rust/production-reality-check
47%
news
Recommended

JavaScript Gets Built-In Iterator Operators in ECMAScript 2025

Finally: Built-in functional programming that should have existed in 2015

OpenAI/ChatGPT
/news/2025-09-06/javascript-iterator-operators-ecmascript
47%
howto
Recommended

Migrate JavaScript to TypeScript Without Losing Your Mind

A battle-tested guide for teams migrating production JavaScript codebases to TypeScript

JavaScript
/howto/migrate-javascript-project-typescript/complete-migration-guide
47%
tool
Popular choice

Northflank - Deploy Stuff Without Kubernetes Nightmares

Discover Northflank, the deployment platform designed to simplify app hosting and development. Learn how it streamlines deployments, avoids Kubernetes complexit

Northflank
/tool/northflank/overview
46%
tool
Popular choice

LM Studio MCP Integration - Connect Your Local AI to Real Tools

Turn your offline model into an actual assistant that can do shit

LM Studio
/tool/lm-studio/mcp-integration
43%

Recommendations combine user behavior, content similarity, research intelligence, and SEO optimization