Skip to main content

Mike Kreuzer

Chris Lattner on Swift

July 14, 2024

Chris Lattner the original author of the Swift language has had a few things to say about it. Lattner's working on a new language called Mojo so he's out & about spruiking that.

The interview's on YouTube, and is worth watching in full, but the money quote on Swift to my mind starts at about 22 minutes, depending on ads & other annoyances, & it's worth quoting the man at length:

Swift, the original idea was factor complexity. So you have really powerful features that are available and accessible within the language, but you don't thrust them in peoples' face[s], you make it so that it's simple to get going then powerful as you dig in, and so progressive disclosure of complexity is this UI paradigm which is, you know, you can have powerful things that are simple to learn, but then enable power users to discover the power as they progress in their experience instead of thrusting all that complexity into their faces all at once…

that was a big focus of my work on Swift, a big focus of the early language. Massively failed in my opinion by the way. So massive lessons learned. Swift has turned into a gigantic, super complicated bag of special cases, special syntax, special stuff. It's all locally well intentioned…

it had a lot of internal technical debt because it was built very rapidly & we didn't expect the adoption to be so quick, & so the whole team was behind, & then instead of fixing the core what the team did – both when I was there, so partially my fault, but also subsequently – was they started adding all these special cases. There's also some things like SwiftUI added result builders & stuff like this. Result builders is a well intentioned meta programming thingy, you get rid of commas to make some code look better on a slide, right. So, a lot of the stuff got added under extreme time pressure to enable a feature like SwiftUI, & there are good aspects to it, but it's one of the reasons that Swift compile times are not great…

…Swift is still a beautiful language, it's amazing, & it's got a lot of really great things in it, but I can't say it's a simple language…

With apologies for any transcription errors on my part.

Now, he's said similar things before. I've said this sort of stuff before on this blog and elsewhere as a simple user of the language. My 2021 post still sums up the history of the language pretty well I feel. But to hear the man himself say it. Oof.

Tags: