What is Swift written in?
The Swift compiler is written in C, C++, Swift, and LLVM (documented). Swift uses a bootstrap chain from Machine Code (reported). Swift is self-hosting.
Relationship Graph
All directly connected languages. Click any node to navigate to its page.
Compiler Implementation
| Language | Confidence | Notes | Source |
|---|---|---|---|
| C | 85% | Early Swift compiler had significant C components | Source |
| C++ | 95% | Swift compiler primarily in C++ | Source |
| Swift | 90% | Swift compiler increasingly written in Swift | Source |
| LLVM | 95% | Swift uses LLVM as compiler backend | Source |
Bootstrap Chain
| Language | Confidence | Notes | Source |
|---|---|---|---|
| Machine Code | 80% | Swift bootstrap chain via LLVM | Source |
Influenced By
- Objective-C — Swift designed as Objective-C successor for Apple
- Haskell — Swift influenced by Haskell's type system
- Rust — Rust influenced Swift's memory safety features
- Python — Swift influenced by Python's readability
Languages Swift Influenced
- Rust — Swift and Rust mutually influenced each other
Frequently Asked Questions
What language is Swift written in?
Swift is primarily implemented in C and C++ and Swift and Machine Code and LLVM. See the implementation section above for details and source references.
What languages influenced Swift?
Swift was influenced by Objective-C, Rust, Haskell among others. See the influence section above for the full list.
Which languages did Swift influence?
Swift influenced Rust among others.
Is Swift self-hosting?
Yes, Swift is self-hosting — its compiler can compile itself.
Evidence Sources
- https://github.com/swiftlang/swift
- https://forums.swift.org/t/self-hosting-swift/
- https://en.wikipedia.org/wiki/Swift_(programming_language)
- https://github.com/apple/swift/blob/main/SwiftCompilerSources/README.md
- https://en.wikipedia.org/wiki/Rust_(programming_language)