Source Code

The code for the Swift project is divided into several open source repositories, all hosted on GitHub.

Compiler and Standard Library

swift
The main Swift repository, which contains the source code for the Swift compiler, standard library, and SourceKit.
swift-driver
The source code for the Swift compiler driver, which coordinates compilation of Swift code.
swift-evolution
Documents related to the continued evolution of Swift, including goals for upcoming releases and proposals for changes to and extensions of Swift.

Directions for building the Swift compiler and standard library, along with its prerequisites, are provided by the main Swift repository’s README file.

Core Libraries

swift-foundation
The source code for the shared implementation of key Foundation API for all platforms, which provides common functionality for all applications. On non-Apple platforms it’s available as the FoundationEssentials and FoundationInternationalization modules.
swift-corelibs-foundation
The source code for the Foundation, FoundationXML, and FoundationNetworking modules on platforms without an Objective-C runtime, such as Linux and Windows. Foundation re-exports swift-foundation and provides a compatibility implementation of the remaining Foundation API.
swift-corelibs-libdispatch
The source code for libdispatch, which provides concurrency primitives for working on multicore hardware.
swift-testing
The source code for Swift Testing, the recommended framework for writing tests for Swift apps and libraries.
swift-corelibs-xctest
The source code for XCTest, which provides fundamental testing infrastructure for Swift apps and libraries.

Package Manager

swift-package-manager
The source code for the Swift package manager.
swift-build
The source code for Swift Build, a high-level build system used by Xcode and the Swift package manager.
swift-llbuild
The source code for llbuild, a low-level build system used by the Swift package manager.
swift-tools-support-core
Contains common infrastructural code for both SwiftPM and llbuild.

Xcode Playground Support

swift-xcode-playground-support
The source code to enable playground integration with Xcode.

Source Tooling

swift-syntax
The source code for SwiftSyntax, which enables Swift tools to parse, inspect, generate, and transform Swift source code.
swift-format
The source code for the formatting technology for Swift source code.
swift-docc
The source code for DocC, the documentation compiler that produces rich API reference documentation and interactive tutorials for Swift frameworks and packages.

SourceKit-LSP Service

sourcekit-lsp
The source code for the SourceKit-LSP language service.
indexstore-db
The source code for the index database library.

Toolchain Installation

swiftly
The source code for swiftly, which installs and manages Swift toolchains.

Swift.org Website

swift-org-website
The source code for the Swift.org website.

Cloned Repositories

Swift builds upon several other open source projects, most notably the LLVM Compiler Infrastructure. Swift’s clones of the repositories of those open source projects contain Swift-specific changes and are merged regularly from their upstream sources. For more information about the clone of the LLVM repository, see LLVM and Swift in the project-operations repository.

llvm-project
The source code for LLVM, with a handful of Swift-specific additions. Merged regularly from the LLVM sources at llvm.org.
swift-cmark
The source code for CommonMark, which is used in the Swift compiler.

Directions for building LLDB for Swift are present in the llvm-project/lldb repository’s README file.