Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
A basic Swift program compiled to WebAssembly that prints 'Hello, SwiftWasm!' to the JavaScript console.
# swift/demo/main.swift
import JavaScriptKit
let console = JSObject.global.console
console.log!("Hello, SwiftWasm!")SwiftWasm is a toolchain and ecosystem that compiles Swift code into WebAssembly, allowing developers to run Swift applications directly in the browser, WASI runtimes, serverless platforms, and edge environments. It brings Swift’s safety, performance, and modern language features to WebAssembly-based execution environments.
Origin & Creator
SwiftWasm originated as an open-source community project led by Max Desiatov and contributors around 2019, expanding the Swift compiler to support WebAssembly targets.
Industrial Note
SwiftWasm is gaining traction for Swift-based web UIs, full-stack Swift apps, serverless Wasm microservices, and Apple ecosystem developers who want to run Swift outside Apple hardware.