[swift-evolution] ABI in Layman's terms?
map at kth.se
Fri Aug 12 19:58:12 CDT 2016
> 11 Aug. 2016 22:57 Slava Pestov via swift-evolution <swift-evolution at swift.org> wrote:
> - The first axis is the machine-level calling conventions and memory layout. For example, what registers to pass function arguments and returns in, the rules for alignment and padding of fields in an aggregate type, which entry points the Swift runtime exports and what their behavior should be. Once we commit to a stable ABI along this axis, you will get interoperability between *compiler versions* -- the same exact library built with one version of the compiler will remain compatible with clients after being recompiled with another version, because their conventions will match up. Note that this does not help you if the library itself changes in any way.
I would just like to add that one very important part of calling conventions is memory ownership.
All memory ownership conventions that end up in the stable ABI have to be supported after it has been declared stable. Adding new ways of transferring (or not transferring) ownership could be handled by adding new types of name mangling, I guess, but since old binaries would use the old model, everyone calling them would have to implement the old conventions as well.
If I'm not totally wrong.
More information about the swift-evolution