‘Massive’ Swift 5.5 release fixes ‘pyramid of doom’ and more

Ryan Daws is a senior editor at TechForge Media, with a seasoned background spanning over a decade in tech journalism. His expertise lies in identifying the latest technological trends, dissecting complex topics, and weaving compelling narratives around the most cutting-edge developments. His articles and interviews with leading industry figures have gained him recognition as a key influencer by organisations such as Onalytica. Publications under his stewardship have since gained recognition from leading analyst houses like Forrester for their performance. Find him on X (@gadget_ry) or Mastodon (@gadgetry@techhub.social)


Apple has debuted Swift 5.5, a “massive” release that fixes its “pyramid of doom” issue among introducing other major changes.

An issue with how Swift previously handled concurrency meant that a “pyramid of doom” of difficult-to-follow nested calls would occur when a developer wrote several asynchronous operations.

Swift language inventor Chris Lattner had previously acknowledged that error handling gets ugly “because Swift’s natural error handling mechanism cannot be used”. In a post, he provided an example of how code ends up looking:

The fix implemented in Swift 5.5 was to adopt the async/await pattern seen in C#, JavaScript, Python, and others. Anonymous closures are also implicitly async if they feature an await expression.

‘Actors’ have also been introduced that allow you to “declare that a bag of state is held within a concurrency domain and then define multiple operations that act upon it.” The data of each actor is protected through data isolation to ensure only a single thread will access it at any given time.

As part of the new concurrency model, “actors provide the same race and memory safety properties as structured concurrency, but provide the familiar abstraction and reuse features that other explicitly declared types in Swift enjoy.”

The additions and changes in Swift 5.5 can justifiably be called “massive”. Here are the proposals that were included in the latest version:

Another headline feature that’s worth digging into a little bit more is package collections.

A package contains Swift source code files and a manifest. As the name suggests, a package collection gathers several together for convenience. “We envision educators and community influencers publishing package collections to go along with course materials or blog posts, removing the friction of using packages for the first time and the cognitive overload of deciding which packages are useful for a particular task,” states the original proposal.

Swift 5.5 is now available in Xcode 13 or it can be grabbed for Ubuntu, CentOS, Amazon Linux 2, or Windows 10.

Head this way for the downloads.

Want to learn about DevOps from leaders in the space? Check out the DevOps-as-a-Service Summit on 1 February 2022, where attendees will learn about the benefits of building collaboration and partnerships in delivery.

Tags: , , , , , , , , , ,

View Comments
Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *