Things Have History
Swift: Apple's secret language, four years in the making

programming-languages

Swift: Apple's secret language, four years in the making

Listen · 4:13

On the afternoon of June 2, 2014, Craig Federighi walked onto the Moscone Center stage in San Francisco and announced to several thousand developers that Apple had built them a new programming language. The audience had not been told this was coming. The language had been in development for four years. Fewer than 250 people inside Apple knew it existed.

The name was Swift.

Chris Lattner had started it in July 2010, mostly alone, on evenings and weekends, while running Apple’s developer tools department by day (Wikipedia). The timing was not accidental. Lattner had joined Apple in 2005 to develop LLVM — the compiler infrastructure he had begun as a graduate student at the University of Illinois at Urbana-Champaign — and by 2010 LLVM had matured to the point where it could support features that Objective-C could not easily hold. Objective-C had been the language of Apple’s platforms since NeXT licensed it in the late 1980s; before that, it dated from Brad Cox and Tom Love’s work in the early 1980s. It was powerful, idiosyncratic, and largely unchanged for three decades (AppleInsider).

Its bracket syntax looked to newcomers like a transcription error. More practically, it offered no protection against null pointer dereferencing — the class of bug that crashes a program when code reaches for a variable that points at nothing. Swift’s organizing conviction was that the compiler should make this category of mistake structurally impossible. Optionals, strong typing, and automatic reference counting were its answers: safety enforced at compile time, not discovered at 3 a.m. by a crash report.

Lattner drew from a wide menu: Objective-C for Cocoa integration, Haskell for type inference, Ruby and Python for syntax, Rust and C# for structural ideas, and several others besides (Wikipedia). The WWDC 2014 app itself became the first publicly shipped program written in Swift — consumed by the audience that had, moments earlier, learned the language existed.

Here is the detail that takes a moment to settle. In the months before the announcement, Lattner’s team had been quietly introducing modules, automatic reference counting, and nullability annotations into Objective-C. To the outside world, these looked like routine modernization. They were, in fact, the track laid for a new language that would need to run alongside the existing frameworks. The iOS developers who had adopted those changes were making Swift’s interoperability possible without knowing it.

Swift went open source on December 3, 2015, under the Apache License 2.0, arriving on GitHub with a compiler, debugger, and package manager ready to run outside Apple’s ecosystem. IBM began shipping Swift on its cloud servers almost immediately. In Stack Overflow’s 2015 developer survey, Swift took first place as the most-loved programming language, with more than 78 percent of Swift users reporting they wanted to keep using it (Wikipedia).

Lattner left Apple in 2017, passed through Tesla and Google, and eventually co-founded Modular — where he built Mojo, a Python superset aimed at AI systems work. The throughline from LLVM to Swift to Mojo is one person’s abiding belief that the compiler is the thing: get the infrastructure right, and the language follows. Get the language right, and everything built on top gets a little easier.

Every Objective-C developer in that Moscone audience would eventually become a Swift developer. Lattner had simply not told them yet.

Sources

Spot a mistake?

Wrong date, broken citation, a fact that doesn't hold? Tell us. It lands in an inbox a human reads and the post can be pulled or corrected.