After ten years of Swift, Apple promises AI-powered tooling and another push toward cross-platform

After ten years of Swift, Apple promises AI-powered tooling and another push toward cross-platform

Apple’s WWDC (Worldwide Developers Conference) is under way in Cupertino, including a focus on the Swift language – now ten years old – with announcements covering Swift 6, AI-powered tooling, and a renewed push toward a cross-platform ecosystem.

The fruit cart will “infuse our tools with the power of generative models,” according to Ken Orr, senior manager, Xcode and Swift Playgrounds, who added that Apple has created its own models with awareness of the latest APIs and language features, as well as best practices. This will power a new predictive engine for code completion in Xcode – Apple’s all-purpose IDE – and the AI will, said Orr, “run locally on your Mac, keeping your code private.”

Another new feature is Swift Assist – an Apple coding companion that accepts natural language input and generates code in response. Unlike code completion, this AI is processed in the cloud. Orr promised that “your code is never stored on the server,” and that it is not used for training models, only for the specific request.

Ted Kremenek, director languages and runtimes, spoke at WWDC about the release of Swift 6, which has been in development for several years. Full release seems imminent, though at the time of writing the current download remains Swift 5.10.1. Swift 5.0 was released in March 2019, though there have been point releases since. At WWDC, Kremenek highlighted compile-time data race safety – which is an opt-in feature because of breaking changes – as a key new feature. He also mentioned Embedded Swift – a subset of Swift for microcontrollers and other embedded systems.

The most notable aspect of Apple’s Swift news, though, is an effort to promote the language beyond Apple platforms. Kremenek said that Apple is “working with the open source community to bring Swift to more platforms and domains.” The initiative includes supporting Swift in Visual Studio Code (VS Code) and other editors that use the Language Server Protocol, used to power smart editor features. Linux support will expand to include Debian and Fedora, adding to existing support for Ubuntu, CentOS, Amazon Linux and Red Hat. Windows support will also be improved.

Kremenek introduced a new GitHub organization which will host repositories “critical to the ecosystem.” It currently includes swift-evolution, for maintaining change proposals, a repository for the official VS Code extension, and another project, called Swiftly, for managing Swift toolchains from the command line, modelled on Rust’s rustup.

In a post on the official Swift site, Kremenek noted that the new organization will include other key repositories including the compiler, core tools, standard libraries, samples, and the content for the website. The migration will be phased to minimize disruption.

Swift 1.0 was introduced in June 2014 as a safe, modern alternative to Objective-C, previously used for most Apple platform development. In 2015 it was made open source, with support for Linux, fostering a hope that it might become a widely used language beyond Apple platforms – but its adoption for general-purpose use has so far been small. IBM, for example, was an early advocate for server-side Swift and created an open source framework called Kitura to support it, but discontinued most of its support in 2019.

Industry watchers will note that in June 2023 Tim Sneath joined Apple as director, CoreOS and developer tools/frameworks. Sneath has a long history of promoting cross-platform app frameworks – including Silverlight at Microsoft and then, most notably, directing product and user experience for Flutter and Dart at Google.

Another boost for cross-platform Swift has come via The Browser Company, which built parts of its Chromium-based Arc browser with Swift on Windows and created bindings for WinRT for that purpose, which are now open source.

Swift for Windows is not really new, and Swift for Linux goes back to 2015. At WWDC, though, VP worldwide developer relations Susan Prescott mentioned in the platform keynote that “Swift is expanding to Windows and Linux” – suggesting that Apple is serious about its new cross-platform push for the language.