Hacker News new | ask | show | jobs
by pipes 53 days ago
I'm eternally confused by what an ABI actually is. Especially now that people say the win 32 api is the stable Linux ABI. Genuine question, what is the difference as they both seem to be conflated.
1 comments

A library with a stable ABI means that newer releases of that library do not break compatibility with old binaries linked against it. This is why old Windows apps still work on newer OSes.

For example in a typical C library, as long as you don't rename or remove any existing functions/exports (or change their signatures), you can continue to add new ones over time without breaking forwards compatibility (old binaries can link/call into the newer library and still work). This is also important for security reasons and not just application compatibility.

Usually projects will only make ABI-stable changes within minor versions, and leave the breaking changes to major versions where upgrading or recompiling the original application becomes necessary.

For C++ this is more complicated because it's all compiler-dependent (no language-defined ABI), and with classes you typically can't re-arrange anything (like class members) without breaking compatibility.

Thank you. So windows historically has been careful to ensure that it's abi is stable where as Linux relies more on users recompiling against binaries, which is a problem if you are shipping binaries rather than source code? Presumably package managers try to handle this by ensuring you dependencies are up to date?
Correct.