Language

Swift

First appeared
2014
Paradigm
Multi-paradigm, compiled, statically typed
Toolchain
Swift 6.0.3
Container image
debian:trixie-20261027-slim + swiftlang 6.0.3-2

Apple introduced Swift in 2014 as the successor to Objective-C, and it’s now the main language for apps on the iPhone, iPad, and Mac. It’s open source and runs on Linux too, which is how it runs here. It aims to be safe by default: values can’t be missing unless their type says so, integer overflow stops the program instead of wrapping, and arrays are copied, not shared.

The implementations use Swift’s standard library plus Foundation, which ships with the compiler and is how Swift reads files and formats numbers on every platform. Neither has statistics or matrices. Packages from the Swift Package Manager, such as Swift Numerics, aren’t installed. The compiler treats every warning as an error.

Quirks

Concepts in Swift

Run the examples locally

You need Docker and Python 3. The harness builds the pinned container and runs every Swift example:

git clone https://github.com/qnixon/dswithx.git
cd dswithx
python3 harness/run_tests.py --language swift