Xwift

Install

Install the stock Swift 6.4.1 toolchain from swift.org, the Swift SDK for WebAssembly and wasmtime to build the proof of concept.

The proof of concept pins every tool it depends on. These are the exact versions it was built with:

ComponentVersion
Swift toolchain (swift.org)6.4.1 (from .swift-version)
Swift SDK for WebAssemblyswift-6.4.1-RELEASE_wasm
wasmtime38.0.1

There is no Xwift download or installer. The Xwift toolchain has not been released. Everything below installs stock tools from swift.org and the Bytecode Alliance, which is what the proof of concept uses today. A xwift CLI that manages this for you is planned.

1. Install Swift 6.4.1

Install swiftly, the official Swift toolchain manager:

curl -O https://download.swift.org/swiftly/darwin/swiftly.pkg && \
installer -pkg swiftly.pkg -target CurrentUserHomeDirectory && \
~/.swiftly/bin/swiftly init --quiet-shell-followup && \
. "${SWIFTLY_HOME_DIR:-$HOME/.swiftly}/env.sh" && \
hash -r

Then install and select Swift 6.4.1:

swiftly install 6.4.1 --use

Use the swift.org toolchain from swiftly rather than the one bundled with Xcode. The Swift SDK for WebAssembly must match the swift.org toolchain version exactly.

Check the version:

swift --version
# Swift version 6.4.1 …

2. Install the Swift SDK for WebAssembly

The SDK is only needed for the WebAssembly target. Install it with its checksum so the download is verified:

swift sdk install https://download.swift.org/swift-6.4.1-release/wasm-sdk/swift-6.4.1-RELEASE/swift-6.4.1-RELEASE_wasm.artifactbundle.tar.gz \
  --checksum 783e6128d174d9f975b4eda68be02a5960681b723ef372e6876a7c2543a365d8

Confirm it is available:

swift sdk list
# swift-6.4.1-RELEASE_wasm

3. Install wasmtime

wasmtime runs the compiled .wasm module. The proof of concept pinned version 38.0.1. On Linux x86_64 that is:

curl -sSfL "https://github.com/bytecodealliance/wasmtime/releases/download/v38.0.1/wasmtime-v38.0.1-x86_64-linux.tar.xz" | tar xJ
export PATH="$PWD/wasmtime-v38.0.1-x86_64-linux:$PATH"
wasmtime --version

For other platforms, download the matching archive from the wasmtime releases page.

Next steps

Continue with Getting started to build, test and run the package.

On this page