3 ms·
It might help to understand API vs. ABI with respect to the C language and CPU architectures. I put definitions here awhile ago, and mentioned the Actually Por
by chubot 4y ago
It might help to understand API vs. ABI with respect to the C language and CPU architectures.
I put definitions here awhile ago, and mentioned the Actually Portable Executable project as an example of taking the ABI philosophy to an extreme, and ignoring APIs (source code).
https://www.oilshell.org/cross-ref.html#API https://www.oilshell.org/cross-ref.html#API
Links to this thread:
https://news.ycombinator.com/item?id=12029321 https://news.ycombinator.com/item?id=12029321
It's unfortunately not explained well in many places, and even experienced C programmers don't understand the details. You won't learn about this in a C programming book, because it's not really part of the C language proper. It sits at an awkward spot between the language, the CPU, and the operating system.
----
The relation to Linus Torvalds is that historically Unix kernels were developed in a single tree and there was no stable ABI. For example I believe OpenBSD and NetBSD are still like this. But Linux is different in that the kernel maintained a stable ABI, and you can run different user utilities on top, without necessarily recompiling them against headers.
Highly related blog post and discussion: https://old.reddit.com/r/ProgrammingLanguages/comments/tg55ow/c_isnt_a_programming_language_anymore_faultlore/ https://old.reddit.com/r/ProgrammingLanguages/comments/tg55o... (including comments by me/oilshell explaining the Unix kernel interface issue)
- rfoo 4y agoIn short, a stable ABI is a must for portable (and backward-compatible) binaries. It does not matter where the stable ABI is. It is fine to have a stable userspace ABI only if you control the userspace. (e.g. Windows)