Apple Open Sources Powerful Swift Programming Language
Apple’s Swift programming language, which has been steadily used by both OS X and iOS developers, has gone open source under an Apache licencse. The source code has launched along with a port that works with Linux. You can build it from the Swift sources or download pre-built binaries for Ubuntu. Currently x86_64 is the only supported architecture on Linux. Apple has also unveiled further plans for the language on their new site, swift.org.
Swift is made up of a number of different projects, meant to be a complete ecosystem for building software. The Swift compiler project interprets Swift syntax, produces diagnostics to help write correct code, and employs LLVM to generate machine instructions. The LLDB project is a debugger that includes a REPL for interactive programming. And the Swift standard library project includes the core types and basic functionality you need to write software in Swift. Apple has released two additional projects for Swift in open source: the Core Libraries project, and a new Swift Package Manager project.
Swift Package Manager. The Swift Package Manager is a new project that is used to build and share Swift code. Apple claims it is focused on ensuring the package manager is great at sharing source code, rather than compiled binary libraries. This project is very early in development.
You can find example package repositories at the Apple home on GitHub, as well as the source code and additional information for the package manager itself.
Core Libraries. The Swift Core Libraries project is a higher-level set of APIs, above the Swift standard library. These libraries offer functionality such as localization, networking primitives, unit testing, user preferences, and more. These libraries also introduce coding conventions that can be used as you write more Swift code, and create new packages.
The core libraries are based on frameworks included in Apple platforms, namely Foundation, libdispatch, and XCTest. The Swift open source versions of these frameworks are intended to make it easy to use the same Swift code with consistent functionality across multiple platforms.
If you're interested in getting started with Swift, here are some a few key links:
- The Swift mailing lists are how to interact
- The Getting Started pages can help you setup a Swift development environment
- The Download page includes pre-built binaries for the supported platforms
- The Swift Evolution Process describes how new features are proposed
- The Apple home on GitHub hosts all the Swift source code