Repolode
swiftlang

swiftlang/swift

The Swift programming language and its compiler toolchain, a memory-safe, high-performance language with seamless access to C and Objective-C.

Stars
70,542
Forks
10,896
Open issues
9,514
Last commit
13 hours ago

What is it?

Swift is a systems-oriented programming language with a modern syntax and memory safety enabled by default. It provides direct access to existing C and Objective-C code and frameworks, which makes it practical for integrating with established platform libraries.

The language includes flow control, data structures and functions along with higher-level constructs such as objects, protocols, closures and generics. It uses modules instead of header files, removing the need to duplicate declarations between headers and implementations.

This repository contains the compiler and toolchain source. The README covers building toolchains with the build-toolchain script, installing a custom toolchain into Xcode on macOS, and troubleshooting build failures related to Xcode versions.

Key features

  • 01Memory-safe by default
  • 02Direct interoperability with C and Objective-C code and frameworks
  • 03Modern syntax with protocols, closures and generics
  • 04Module system that removes the need for header files
  • 05Build-toolchain script for producing local toolchain snapshots

Use cases

  • Building applications for Apple platforms that reuse existing Objective-C or C libraries
  • Contributing fixes or features to the Swift compiler
  • Building a custom Swift toolchain for development or distribution
  • Learning how a production compiler for a modern language is structured

Quick start

  1. 1

    Read the Getting Started guide for build prerequisites

  2. 2

    Build a Swift toolchain with the build-toolchain script

    ./swift/utils/build-toolchain $BUNDLE_PREFIX

Things to know

  • Building from source is a large C++ project that requires a specific Xcode release on macOS.
  • Building the toolchain is a heavy, long process and needs significant disk space and compute.

In collections

Topics

FAQ

What is swift?
The Swift programming language and its compiler toolchain, a memory-safe, high-performance language with seamless access to C and Objective-C. Swift is a systems-oriented programming language with a modern syntax and memory safety enabled by default. It provides direct access to existing C and Objective-C code and frameworks, which makes it practical for integrating with established platform libraries.
Is swift free to use? What license does it have?
swift is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is swift still maintained?
Actively maintained. The last commit to swift was on Nov 6, 2026.
What can I use swift for?
Building applications for Apple platforms that reuse existing Objective-C or C libraries Contributing fixes or features to the Swift compiler Building a custom Swift toolchain for development or distribution Learning how a production compiler for a modern language is structured
How do I install swift?
Read the Getting Started guide for build prerequisites Build a Swift toolchain with the build-toolchain script: ./swift/utils/build-toolchain $BUNDLE_PREFIX
Where can I get swift?
The source code and installation instructions are on GitHub: https://github.com/swiftlang/swift

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects