Swift the best choice to succeed C++, Apple says

By Paul Krill

In a June 10 keynote presentation at Apple’s World Wide Developers Conference, Ted Kremenek, Apple director of languages and runtimes, argued that Swift is the best programming language to replace C++.

Swift was introduced by Apple in 2014 as the successor to Objective-C, and Kremenek believes it will overtake C++ as well. “Swift’s safety, speed, and approachability, combined with built-in C and C++ interoperability, mean Swift is the best choice to succeed C++,” Kremenek said.

C++ and C have drawn fire from the White House, which released a report in February urging developers to move to memory-safe programming languages. Apple is committed to adopting Swift in its own C++ code bases, Kremenek said. Prior to Swift, software on Apple’s devices was written using C, C++, and Objective-C.

Apple this week announced plans to migrate Swift to a dedicated GitHub organization, github.com/swiftlang. Swift 6, which is planned for release this year, promises to make concurrent programming safer and easier through full data race safety. A data race happens when different parts of code try to modify and access the same data at the same time.

“Swift 6 eliminates these kinds of bugs by diagnosing them at compile time,” Kremenek said. A new language mode in Swift 6 language mode will enable compile-time data race safety. Because data race safety may require changes to code, the new Swift 6 language mode is opt-in. Apple previously highlighted data race safety in Swift 5.10 in March, advising that the opt-in mode planned for Swift 6 enforces full data isolation by default.

Also planned for Swift 6 is expanded Linux support, covering the Debian and Fedora Linux distributions, and improved support for Windows. Generics also are eyed for improvement in Swift 6, with a new subset planned for targeting constrained environments such as OS kernels and microcontrollers. Apple also is investing in Swift support in Microsoft’s Visual Studio Code editor and other editors that leverage the Language Server Protocol.

With the creation of github.com/swiftlang, Apple believes it is creating an even more conducive environment for collaboration and innovation. As a first step, Apple was set to move the swift-evolution repository on June 10, with other repositories transitioning in coming weeks. Projects such as the Swift compiler and key libraries will be hosted on the GitHub site.

© Info World