UPDATED 15:52 EDT / SEPTEMBER 19 2016

NEWS

Apple’s Swift 3.0 revitalizes the language but breaks backward compatibility

Last week Apple Inc. announced the 3.0 version of its Swift programming language, which makes for the first major release of the language since it was open sourced. This release brings major improvements to the core language, functionality, and major changes to the Linux port of Swift libraries. All this is nice for programmers working with Swift, however version 3.0 is also not backward compatible with the previous version 2.3.

Apple first launched its Swift programming language in 2014 as a platform for developers to rapidly program for iOS and iOS X app development environments, and it is extremely similar to the popular Objective-C programming language. In December 2015, Apple open sourced the language, its compiler and tools. This move gave developers the power to build their own tools and port Swift into the environments in which they work.

The Swift 3.0 version announcement also brings the first release of the Swift Package Manager. Package managers act to facilitate the management of Swift code by automating the process of downloading, compiling and linking dependencies during the build process for development projects. The addition of a manager rounds-out the tools available with Swift to put it on similar footing to most other mature languages.

A major source-breaking release: Swift 3.0 surges ahead

In the blog post announcing the release of Swift 3.0 Apple outlines why this new major update no longer supports past versions, and lists the changes that make this a massive update to the language and tools.

The first major change is better translation of Objective-C APIs into Swift. As Swift is a language extremely similar to Objective-C the language is designed to compile with code written in Objective-C. This move means shifting functions, types, methods, properties, etc. in Objective-C into language prototypes that fit Swift’s language design guidelines. As a result of this translation, code originally imported from Objective-C for Swift projects will no longer work in Swift 3.0 and must be re-imported.

The second major change will apply API guidelines to the standard library in a move to make Swift’s API syntax less wordy. The reason for this is that coding changing from C or Objective-C into Swift can tend to look complex and call on a multitude of functions with many operands for even otherwise simple code.

This change, like the other, means that older code will no longer work. Apple writes, “The proposed changes are massively source-breaking for Swift code, and will require a migrator to translate Swift 2 code into Swift 3 code.”

Moving forward with a cleaner language

The upcoming release of Swift 3.0 was announced at Apple’s developer focused conference WWDC 2016 in June. During the announcement developers heard about the upcoming changes and heard warnings about upcoming backward compatibility issues. This change has been couched in the need to streamline the language, but some developers have found it frustrating (as evidenced by YouTube comments on the WWDC announcement video above). Swift being a newly invented language works in its favor for source-breaking changes because developers are still adapting to its use and adoption is still underway.

Apple’s objective with this change is to provide a cleaner syntax for developers using Swift to entice more programmers to use the language. The downside is that now early adopters of Swift will suffer the burden of porting code from previous versions in order to keep apps compiling with the most recent release.

In the past year, Swift has remained at rank 17 in Redmonk’s programming language survey and Objective-C has stayed at 10 unmoving. For language use, Swift has remained there since jumping up to 22 from 68 in January 2015. Swift’s popularity got the language put on the map for iOS app development, but cleaning up the syntax and the APIs will grease the wheels when it comes to developer’s interest in using it on other platforms.

Featured image credit: Tristan via photopin (license)

A message from John Furrier, co-founder of SiliconANGLE:

Your vote of support is important to us and it helps us keep the content FREE.

One click below supports our mission to provide free, deep, and relevant content.  

Join our community on YouTube

Join the community that includes more than 15,000 #CubeAlumni experts, including Amazon.com CEO Andy Jassy, Dell Technologies founder and CEO Michael Dell, Intel CEO Pat Gelsinger, and many more luminaries and experts.

“TheCUBE is an important partner to the industry. You guys really are a part of our events and we really appreciate you coming and I know people appreciate the content you create as well” – Andy Jassy

THANK YOU