What is ABI Stability?

I’ll be honest. I was a little bit disappointed with this years WWDC when ABI (Application Binary Interface) stability wasn’t introduced. It promises a lot and if you’re not aware of ABI, ill quickly explain what it is.

What is ABI Stability?

  • At runtime swift binaries interact with other libraries and components through an ABI. It defines low-level details like how to call a specific function, where metadata is and how to access it and finally how data is representing in memory.
  • Currently swift lives within each app on the device. Thus if an app was created in swift 2.0 then it will use the swift 2.0 ABI library and if it the app was built using swift 3.0 then it would use the 3.0 ABI library.
  • When ABI Stability is released for Swift. The ABI will live within the iOS and the ABI will become compatible with EVERY version of swift. Whether it will be a Swift 5.0 app or a swift 5.1 app and 5.3 is embedded the app will access the 5.3 version

So why does it matter?

  • The main reason for me is that the language itself will change less frequently. Everybody remembers the awful time when swift 2 became swift 3.
  • Fewer migrations
  • The size of the bundles will be reduced
  • We can create Pre-compiled frameworks

So it’s a big thing within the Swift community and we are now going to have to wait until early 2019. Maybe this is for the best. Apple has got to get this right the first time to reduce problems and upsets in the future.

Still, that doesn’t mean there have been no advancements in Swift. So the following posts will examine and explain what has changed with Swift since 2017 with the introduction of Swift 4.1  and Swift 4.2.