Paul Krill
Editor at Large

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

news
Jun 11, 20242 mins

Company cites safety, speed, approachability, and built-in C and C++ interoperability as Swift’s compelling advantages.

Crown, Royalty. Gold glitter streams from a royal crown.
Credit: tomertu/Shutterstock

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.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author