Thanks to ABI Stability, Swift 5.1 is binary compatible with Swift 5. Now Swift 5.1 achieves Module Format Stability which would enable library compatibility at compile time. Now we can use third-party libraries without worrying about which version of the Swift compiler they were built with.
While ABI stability ensures app compatibility at runtime, module stability enables library compatibility at compile time. Up until when Swift 5.1 was intoduced, Swift used an opaque archive format called
swiftmodule to describe the interface of a library. The
swiftmodule format is tied to the compiler version, which means an app developer can’t import a framework if it was built with a different version of Swift. That is, the app developer and the library author have to be using the same version of the compiler.
Module format stability stabilizes the module file to produce a stable and textual
.swiftinterface, which is the compiler’s representation of the public interfaces of a framework. This includes API declarations and inlineable code. The module file is used by the compiler for performing necessary tasks such as type checking and code generation when compiling client code using a framework.