Write once.Run everything.
A cross-platform toolchain for the Swift language, based on Swift 6.4.1.
One language. One package. Every platform.
A toolchain, a CLI, a UI framework and system APIs for every platform.
Toolchain
The Xwift toolchain, based on Swift 6.4.1.
CLI
One xwift command to scaffold, build and run for any target: new, build, run --target. It is not available yet.
UI framework
A declarative UI layer that renders natively on each platform. It has not been started in code yet.
System APIs
Portable access to files, networking, windows and devices behind one API surface. Planned after the CLI.
Platforms.
One toolchain for every platform.
- macOS
- Linux
- Windows
- Web
- iOS
- Android
Straight from the proof of concept.
PlatformInfo resolves the target at compile time. The same source becomes a native binary on macOS, Linux and Windows, and a .wasm module under WASI, with stock Swift 6.4.1. Walk through it
/// Compile-time description of the platform Xwift was built for.
public struct PlatformInfo: Sendable, Equatable, CustomStringConvertible {
public static let current = PlatformInfo(
os: currentOS,
architecture: currentArchitecture,
pointerBitWidth: MemoryLayout<Int>.size * 8
)
private static var currentOS: OperatingSystem {
#if os(macOS)
return .macOS
#elseif os(Linux)
return .linux
#elseif os(Windows)
return .windows
#elseif os(WASI)
return .wasi
// …iOS and Android branches elided
#else
return .unknown
#endif
}
}# native: macOS, Linux, Windows
swift build && swift test
swift run xwift-hello
# WebAssembly (WASI)
swift build -c release \
--swift-sdk swift-6.4.1-RELEASE_wasm \
--product xwift-hello
wasmtime .build/release/xwift-hello.wasm
# Hello from Xwift on wasi-wasm32 (32-bit)!Build it with us.
Reproduce the proof of concept on your own machine and follow the roadmap as it turns into code.