    Skip to content

      Navigation Menu

            Sign in Appearance settings
                * Platform
                        + AI CODE CREATION
                            o GitHub Copilot Write better code with AI
                            o GitHub Copilot app Direct agents from issue to merge
                            o MCP Registry Integrate external tools
                        + DEVELOPER WORKFLOWS
                            o Actions Automate any workflow
                            o Codespaces Instant dev environments
                            o Issues Plan and track work
                            o Code Review Manage code changes
                            o Code Quality Enforce quality at merge
                        + APPLICATION SECURITY
                            o GitHub Advanced Security Find and fix vulnerabilities
                            o Code security Secure your code as you build
                            o Secret protection Stop leaks before they start
                        + EXPLORE
                            o Why GitHub
                            o Documentation
                            o Blog
                            o Changelog
                            o Marketplace
                      View all features
                * Solutions
                        + BY COMPANY SIZE
                            o Enterprises
                            o Small and medium teams
                            o Startups
                            o Nonprofits
                        + BY USE CASE
                            o App Modernization
                            o DevSecOps
                            o DevOps
                            o CI/CD
                            o View all use cases
                        + BY INDUSTRY
                            o Healthcare
                            o Financial services
                            o Manufacturing
                            o Government
                            o View all industries
                      View all solutions
                * Resources
                        + EXPLORE BY TOPIC
                            o AI
                            o Software Development
                            o DevOps
                            o Security
                            o View all topics
                        + EXPLORE BY TYPE
                            o Customer stories
                            o Events & webinars
                            o Ebooks & reports
                            o Business insights
                            o GitHub Skills
                        + SUPPORT & SERVICES
                            o Documentation
                            o Customer support
                            o Community forum
                            o Trust center
                            o Partners
                      View all resources
                * Open Source
                        + COMMUNITY
                            o GitHub Sponsors Fund open source developers
                        + PROGRAMS
                            o Security Lab
                            o Maintainer Community
                            o Accelerator
                            o GitHub Stars
                            o Archive Program
                        + REPOSITORIES
                            o Topics
                            o Trending
                            o Collections
                * Enterprise
                        + ENTERPRISE SOLUTIONS
                            o Enterprise platform AI-powered developer platform
                        + AVAILABLE ADD-ONS
                            o GitHub Advanced Security Enterprise-grade security features
                            o Copilot for Business Enterprise-grade AI features
                            o Premium Support Enterprise-grade 24/7 support
              * Pricing
                Type / to search
                Sign in
              Sign up Appearance settings
      You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

              Uh oh!

              There was an error while loading. Please reload this page.

              swiftlang / swift Public
              * Notifications You must be signed in to change notification settings
              * Fork 10.8k
                * Star 70.2k
          * Code
          * Issues 5k+
          * Pull requests 1.6k
          * Security and quality 0
          * Insights
          Additional navigation options
                  * Code
                  * Issues
                  * Pull requests
                  * Security and quality
                  * Insights
                                              main
                                          Branches Tags
                                            Go to file
                                        Code
                                          Open more actions menu

                                        Folders and files

                                          Name                          Name                            Last commit message    Last commit date
                                            Latest commit             
                                                                      
                                                History               
                                                                      
                                                203,962 Commits       
                                                  203,962 Commits     
                                                  .github                       .github                                                        
                                                  Runtimes                      Runtimes                                                       
                                                  SwiftCompilerSources          SwiftCompilerSources                                           
                                                  apinotes                      apinotes                                                       
                                                  benchmark                     benchmark                                                      
                                                  bindings/ xml                 bindings/ xml                                                  
                                                  cmake                         cmake                                                          
                                                  docs                          docs                                                           
                                                  include                       include                                                        
                                                  lib                           lib                                                            
                                                  localization                  localization                                                   
                                                  stdlib                        stdlib                                                         
                                                  test                          test                                                           
                                                  tools                         tools                                                          
                                                  unittests                     unittests                                                      
                                                  userdocs                      userdocs                                                       
                                                  utils                         utils                                                          
                                                  validation-test               validation-test                                                
                                                  .clang-format                 .clang-format                                                  
                                                  .clang-tidy                   .clang-tidy                                                    
                                                  .dir-locals.el                .dir-locals.el                                                 
                                                  .editorconfig                 .editorconfig                                                  
                                                  .flake8                       .flake8                                                        
                                                  .gitattributes                .gitattributes                                                 
                                                  .gitignore                    .gitignore                                                     
                                                  .mailmap                      .mailmap                                                       
                                                  Brewfile                      Brewfile                                                       
                                                  CHANGELOG.md                  CHANGELOG.md                                                   
                                                  CMakeLists.txt                CMakeLists.txt                                                 
                                                  CODE_OWNERS.TXT               CODE_OWNERS.TXT                                                
                                                  CONTRIBUTING.md               CONTRIBUTING.md                                                
                                                  LICENSE.txt                   LICENSE.txt                                                    
                                                  README.md                     README.md                                                      
                                            View all files            
                                          

                                              Repository files navigation

                                                * 
                                                * README
                                                * Code of conduct
                                                * Contributing
                                                * Apache-2.0 license
                                                * Security
                                                More items

                                                Swift Programming Language

                                                Welcome to Swift

                                              Swift is a high-performance system programming language. It has a clean and modern syntax, offers seamless access to existing C and Objective-C code and frameworks, and is memory-safe by default.

                                              Although inspired by Objective-C and many other languages, Swift is not itself a C-derived language. As a complete and independent language, Swift packages core features like flow control, data structures, and functions, with high-level constructs like objects, protocols, closures, and generics. Swift embraces modules, eliminating the need for headers and the code duplication they entail.

                                              To learn more about using the language, visit swift.org. To learn more about the compiler's internal design, see the documentation index.

                                                * Contributing to Swift
                                                * Getting Started
                                                    + Swift Toolchains
                                                    + Build Failures
                                                * Learning More

                                                Contributing to Swift

                                              Contributions to Swift are welcomed and encouraged! Please see the Contributing to Swift guide.

                                              Before submitting the pull request, please make sure you have tested your changes and that they follow the Swift project guidelines for contributing code.

                                              To be a truly great community, Swift.org needs to welcome developers from all walks of life, with different backgrounds, and with a wide range of experience. A diverse and friendly community will have more great ideas, more unique perspectives, and produce more great code. We will work diligently to make the Swift community welcoming to everyone.

                                              To give clarity of what is expected of our members, Swift has adopted the code of conduct defined by the Contributor Covenant. This document is used across many open source communities, and we think it articulates our values well. For more, see the Code of Conduct.

                                                Getting Started

                                              If you are interested in:

                                                * Contributing fixes and features to the compiler: See our How to Submit Your First Pull Request guide.
                                                * Building the compiler as a one-off: See our Getting Started guide.
                                                * Building a toolchain as a one-off: Follow the Getting Started guide up until the "Building the project" section. After that, follow the instructions in the Swift Toolchains section below.

                                              We also have an FAQ that answers common questions.

                                                Swift Toolchains

                                                Building

                                              Swift toolchains are created using the script build-toolchain. This script is used by swift.org's CI to produce snapshots and can allow for one to locally reproduce such builds for development or distribution purposes. A typical invocation looks like the following:

                                                  $ ./swift/utils/build-toolchain $BUNDLE_PREFIX

                                              where $BUNDLE_PREFIX is a string that will be prepended to the build date to give the bundle identifier of the toolchain's Info.plist. For instance, if $BUNDLE_PREFIX was com.example, the toolchain produced will have the bundle identifier com.example.YYYYMMDD. It will be created in the directory you run the script with a filename of the form: swift-LOCAL-YYYY-MM-DD-a-osx.tar.gz.

                                              Beyond building the toolchain, build-toolchain also supports the following (non-exhaustive) set of useful options:

                                                * --dry-run: Perform a dry run build. This is off by default.
                                                * --test: Test the toolchain after it has been compiled. This is off by default.
                                                * --distcc: Use distcc to speed up the build by distributing the C++ part of the swift build. This is off by default.
                                                * --sccache: Use sccache to speed up subsequent builds of the compiler by caching more C++ build artifacts. This is off by default.

                                              More options may be added over time. Please pass --help to build-toolchain to see the full set of options.

                                                Installing into Xcode

                                              On macOS if one wants to install such a toolchain into Xcode:

                                               1. Untar and copy the toolchain to one of /Library/Developer/Toolchains/ or ~/Library/Developer/Toolchains/. E.g.:
                                                  $ sudo tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx.tar.gz -C /
                                                  $ tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx.tar.gz -C ~/

                                              The script also generates an archive containing debug symbols which can be installed over the main archive allowing symbolication of any compiler crashes.

                                                  $ sudo tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx-symbols.tar.gz -C /
                                                  $ tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx-symbols.tar.gz -C ~/
                                               1. Specify the local toolchain for Xcode's use via Xcode->Toolchains.

                                                Build Failures

                                              Try the suggestions in Troubleshooting build issues.

                                              Make sure you are using the correct release of Xcode.

                                              If you have changed Xcode versions but still encounter errors that appear to be related to the Xcode version, try passing --clean to build-script.

                                              When a new version of Xcode is released, you can update your build without recompiling the entire project by passing --reconfigure to build-script.

                                        About

                                        The Swift Programming Language

                                          swift.org

                                        Resources

                                          Readme
                                          Apache-2.0 license

                                        Code of conduct

                                          Code of conduct

                                        Contributing

                                          Contributing

                                        Security policy

                                          Security policy
                                          Activity
                                          Custom properties

                                        Stars

                                          70.2k stars

                                        Watchers

                                          2.4k watching

                                        Forks

                                          10.8k forks
                                          Report repository

                                        Releases

                                        Used by

                                        Contributors

                                        Languages

    Footer

        © 2026 GitHub, Inc.

      Footer navigation

        * Terms
        * Privacy
        * Security
        * Status
        * Community
        * Docs
        * Contact
        * Manage cookies
        * Do not share my personal information
      You can’t perform that action at this time.