ABI, Application Binary Interface does not have a direct relationship with
API , but it has some similarity. >
Just as the API is the way codes communicate through source , the ABI is how codes communicate through the target . The API is about what the compiler gets to work, the ABI is about what it issues to run.
As the API is about specifying how communication should occur with your code, ABI is the specification of how communication should occur internally in the executable.
The specification determines:
- size and arrangement of data
- function call convention, where arguments are passed, which goes by register and which by stack, and how
- how the OS function calls should occur
- binary code format.
It only makes sense to understand ABI in languages that generate native code and communicate with other compilers, in the same or different languages, or have direct access to the operating system. If they generate different ABI compiler codes they probably will not be able to talk directly and require some intermediation. So some things will always have to call a DLL.
In the Wikipedia article has an image that best shows this relationship: