compilers and linkers adhere to in order to compile your program and execute properly • Interface for app to use external library at OS at binary level • Specifies the calling conventions that the libraries should respect to • Specifies the in memory layout of data types, classes, structs, etc Binary 1 Binary 2
shall not change i.e the order of arguments, return types, etc • Interface for a library should be forward compatible for future versions of the compiler • Stable definition of data type and data structures • Data structures should have a definite data layout • Application built with a specific swift version will be compatible with different Swift versions 5.0 6.x 5.0
defined in-memory layout for instances • Type metadata must either have a defined memory layout, or have a set of defined APIs for querying the metadata of a type • Exported libraries need to have unique names which binaries should agree and this achieved via name mangling. • Calling conventions should be respected by every exposed functions of external libraries • Runtime API should be stable • Swift standard library should expose stable APIs
given type • Size, Offset and Alignment of an object in memory • Static and Opaque Layout • Eg - Non final Class Instances(Opaque) and Struct layout(Static) in memory
ABI is how to access this information • To stabilise metadata need to provide metadata read/write functions alongside the runtime to interact with the metadata • Eg. Function Metadata, Class Metadata(V tables)
their caller • Says how are parameters, return values and return addresses placed on register • Order of argument passing • What metadata of arguments represents
• Swift module file - Binary equivalent of C or Obj C header file • Swift module is tied to current compiler version • Interface for a Swift 5 framework will work with >Swift 5 compiler • Includes API declaration and inlinable code • Swift Interface - Generated by Xcode if - enable-library-evolution flag is enabled 7.x 6.x 6.x
to recompile its clients • Giving library authors the flexibility to add to their public interface and to change the implementation details • Eg of language features enabling these - @frozen enums and structs 6.x 7.x
Editors supported compatibility for fewer languages • Integration code of specific languages are written down in IDEs • Implementation are different across different languages and IDEs • Performance of language varies from one IDE to another
to implement support for each language • Provides common set of functionality for supported languages • Provides language specific smarts inside a server that can communicate with development tool • Provide support for feature such as autocompletion, go-to definition, etc
stable • Make build times faster with the help of module stability • Swift can readily be used for cross platform development • With LSP, Swift can be written on different IDEs