# Swift

> Programming language for building apps on Apple platforms such as iOS and macOS.

- **Appeared:** 2014
- **Creators:** Chris Lattner
- **Maintained by:** Apple
- **Type:** mobile
- **Status:** alive
- **Born from:** Chris Lattner started Swift at Apple in July 2010. Objective-C sat on top of C, with C's pointers and unchecked memory, and Lattner later said that memory safety could not be added to Objective-C without removing the C underneath, which would no longer be Objective-C.
- **Reacts to:** objective-c, rust, haskell, ruby, python, csharp
- **Trade-offs:** reference counted; static types; compiles to native code; concurrency: async, actors. Cost: Tooling and libraries are strongest on Apple platforms, reference counting needs weak references to break cycles by hand, and the binary interface was only declared stable in 2019.
- **Slots:** mobile ●●● strong; server ●○○ weak (Server frameworks such as Vapor exist, but server use is small.); browser ○○○ none (Not a web page language.)
- **Alternatives:** objective-c, kotlin, dart, typescript
- **Won where:** Apple's platforms, for which Apple describes Swift as its language [source](https://developer.apple.com/swift/); SwiftUI, Apple's framework for app interfaces on its platforms, available from iOS 13 and macOS 10.15 [source](https://developer.apple.com/documentation/swiftui.md)
- **Timeline:** 2010: Chris Lattner starts Swift at Apple in July 2010 [source](https://nondot.org/sabre/); 2014: Apple announces Swift at WWDC 2014 as a beta for iOS 8 and OS X Yosemite [source](https://www.infoq.com/news/2014/06/apple-swift); 2015: Apple releases Swift as open source under Apache 2.0, with Linux support [source](https://www.apple.com/nz/newsroom/2015/12/03Apple-Releases-Swift-as-Open-Source/); 2019: Swift 5 is declared ABI stable on Apple platforms [source](https://swift.org/blog/abi-stability-and-more/)
- **Links:** [website](https://www.swift.org/)
- **PLDB:** https://pldb.io/concepts/swift.html
- **Sources:** https://nondot.org/sabre/, https://www.infoq.com/news/2014/06/apple-swift, https://www.apple.com/nz/newsroom/2015/12/03Apple-Releases-Swift-as-Open-Source/, https://swift.org/blog/abi-stability-and-more/, https://developer.apple.com/swift/, https://developer.apple.com/documentation/swiftui.md, https://oleb.net/2019/chris-lattner-swift-origins/, https://pldb.io/concepts/swift.html
- **Verified:** no, draft of 2026-10-30
- **Canonical:** https://langwhy.dev/lang/swift/

## Why it exists

Chris Lattner started Swift at Apple in July 2010 ([Lattner, history of Swift](https://nondot.org/sabre/)). Objective-C was C with Smalltalk-style messaging on top, so it inherited C's pointers and unchecked memory. In a 2019 podcast Lattner explained why the team did not simply fix Objective-C: "you can't retrofit memory safety into Objective-C without removing the C", and removing the C would leave something that was "not Objective-C anymore" ([Ole Begemann, Chris Lattner on the origins of Swift](https://oleb.net/2019/chris-lattner-swift-origins/)). Apple announced Swift at WWDC 2014 as a beta for iOS 8 and OS X Yosemite ([InfoQ](https://www.infoq.com/news/2014/06/apple-swift)).

## What it trades away

Swift is strongest on Apple platforms, and outside them the tooling and libraries are thinner. Its binary interface was only declared stable with Swift 5 in 2019, which means that compiled code from one compiler version could not be relied on to work with another before then ([Swift.org](https://swift.org/blog/abi-stability-and-more/)). Reference counting also means that cycles of objects have to be broken by hand with weak references.

## Where it won

Apple describes Swift as its language for all Apple platforms ([Apple](https://developer.apple.com/swift/)), and its SwiftUI framework for app interfaces has been available since iOS 13 and macOS 10.15 ([Apple SwiftUI](https://developer.apple.com/documentation/swiftui.md)). Apple released Swift as open source under the Apache 2.0 licence on 4 December 2015, with support for Linux as well as Apple platforms ([Apple press release](https://www.apple.com/nz/newsroom/2015/12/03Apple-Releases-Swift-as-Open-Source/)). Server use, with frameworks such as Vapor, is much smaller than app development.

---
Data: CC0, https://github.com/langwhy/langwhy/blob/main/data/languages/swift.yaml
