What is Swift written in?

Swift is self-hosting: its compiler is written in Swift itself. It also relies on C, C++, and LLVM in its toolchain.

Swift is a general-purpose, multi-paradigm, compiled programming language, first released in 2014.

Implementation

LayerWritten inNotes
CompilerC (since 2014)Early Swift compiler had significant C components
CompilerC++ (since 2014)Swift compiler primarily in C++
CompilerSwift (since 2019)Swift compiler increasingly written in Swift
BootstrapMachine Code (since 2022)Swift bootstrap chain via LLVM
CompilerLLVM (since 2014)Swift uses LLVM as compiler backend

Self-hosting

Swift is a self-hosting language: its compiler is written in Swift itself. Self-hosting means the compiler can compile its own source code, which is a milestone in a language's maturity. New versions of the compiler are built using an older version of the same compiler, a process called bootstrapping.

Self-hosting also acts as a practical stress test: if a language can compile its own compiler, most core language features have been validated in a complex, real-world workload. See what is compiler bootstrapping for a full explanation.

Explore in the Graph

See Swift's full lineage, including all implementation and influence relationships, in the interactive graph.

Open Interactive Graph →

Or view the Swift language page for the complete record.

Related Pages