apple/swift
Swift project overview
This wiki documents the Swift programming language repository (apple/swift), which contains the Swift compiler, the Swift runtime, the Swift standard library, and the supporting toolchain (driver, frontend, SourceKit, demangler, IDE tools, and more). Swift is a high-performance system programming language with a clean syntax, seamless C and Objective-C interop, and memory safety by default.
What lives in this repo
The apple/swift repository is the upstream source for the Swift toolchain. It produces:
- The
swift-frontendcompiler and theswiftdriver. - The Swift runtime library that supports type metadata, reference counting, exclusivity, casting, dynamic dispatch, and the Concurrency runtime.
- The Swift standard library (
Swiftmodule) —Array,Dictionary,String,Sequence/Collection, generics machinery, etc. - Companion runtime modules:
_Concurrency,Distributed,Observation,Synchronization,RegexBuilder,_StringProcessing,Cxx, and more. - Developer tools that ship alongside the compiler:
swift-demangle,swift-ide-test,swift-refactor,swift-inspect,swift-reflection-dump,sourcekit-lsphost (SourceKit),swift-plugin-server, etc.
The compiler is implemented mostly in C++, with an increasing amount of Swift implementation in SwiftCompilerSources/. The standard library is implemented in Swift on top of low-level primitives (Builtin) plus a C++ runtime in stdlib/public/runtime/.
How to use this wiki
- New contributors should start at Getting started and read Architecture to learn how source flows through the compiler.
- Engineers debugging compiler bugs should read Architecture, then jump to the relevant systems/ page.
- Stdlib contributors should read Standard library and Patterns and conventions.
- Anyone touching SIL should read the
docs/SIL/folder in addition to SIL and the SIL optimizer.
Key entry points
| Entry point | Purpose |
|---|---|
tools/driver/driver.cpp |
The swift / swiftc binary entry point |
lib/DriverTool/DriverTool.cpp |
Dispatches to subcommands (frontend, repl, ...) |
lib/FrontendTool/FrontendTool.cpp |
The compiler frontend body |
stdlib/public/core/ |
Swift standard library source |
stdlib/public/runtime/ |
Swift runtime library source |
SwiftCompilerSources/Sources/ |
Swift-implemented compiler subsystems |
utils/build-script |
The build entry point for contributors |
Quick links
- Architecture — compilation pipeline and component map
- Glossary — terms used throughout the codebase
- How to contribute — development workflow
- By the numbers — codebase statistics
- Lore — history and major eras
- Maintainers — code owners by area
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.
Next
Architecture