Skip to content

Swift

Swift 6.4, a C compiler, pkg-config, OpenSSL 3, zlib, and libcurl. The verified baseline is Linux x86_64 in Swift 5 language mode.

From a prepared source module containing a main package:

Terminal window
goalchemy compile -target swift -out out/swift .
cd out/swift
sh run.sh

Or use goalchemy run -target swift . to compile and execute in a temporary directory. Add -gate cooperative for source tasks or suspending operations.

Swift is experimental. It emits native Swift plus a small C module: main.swift, package-owned pkg_*.swift files, shared.swift, selected rt/ files, and run.sh. All outputs currently include native prerequisites, even for pure logic.

Every output includes its own README.md, selected runtime files, source mappings, and goalchemy.manifest.json. See the full output reference for the inventory and entry behavior.

Non-main output emits a SwiftPM product named GoalchemyGenerated. Public values are typed and calls expose synchronous or asynchronous operations. Source errors become GoalchemyFailure. Read SwiftPM library API for ownership, callbacks, cancellation, and stream examples.

macOS, iOS, and Apple SDK integration have not been verified. SWIFTC and CC select compiler binaries. .swift.lines sidecars retain source positions. ARC handles ordinary acyclic values and tracing breaks unreachable source cycles at scheduler safepoints.

Swift setup, semantics, and library API