Greetings!
My name is badasahog and I’m new to Haiku (and non-Windows operating systems in general)
I wanted to fully document my understanding of the upcoming ABI crisis so that I can get confirmation that I understand it correctly, and possibly help maintainers add a section about it to the website so that new contributors can understand what’s going on.
Operating systems are (usually) written in a programming language that compiles into machine code. What the programming language actually means (ie its behavior) is defined by a standards document. This means that different compilers of a language will all create binaries that do the same thing as long as you’re not leaning into undefined behavior.
The trouble with this is that standards documents don’t often define how programs do what they do, just what they do (often referred to as the as-if rule).
This shouldn’t effect the developer, but it can in some situations. In C this isn’t such a big problem because as long as you have the same calling convention (ie the way that data is passed between function calls) you should be good to go. Binaries compiled with different compilers should be interoperable.
The trouble is that C++ is far more complex, especially when it comes to classes. What order is the vtable in? where is it located? All these things and more can create problems.
Unlike other operating systems, which have a pure-C interface (such as posix and winapi), the Haiku API uses classes. This creates a problem if a program compiled with one compiler tries to communicate with the Haiku kernel compiled with a different compiler.
In other words, we all need to agree (Haiku developers and Haiku application developers) to use one ABI.
Unfortunately this decision has already been made for us, by the developers of BeOS (the predecessor of Haiku).
In order for Haiku to run original BeOS applications it needs to be compiled with the same ABI that was used when the OS was developed.
Unfortunately, this ABI is no longer used by modern compilers so Haiku developers need to either modify the compiler they want to use after every new release to conform to the ABI, or be stuck using legacy versions which are old and don’t support the latest C++ features.
This is why Haiku is written in C++98, which is making development more difficult.
Did I get all that right?
If not please correct me! I am excited to learn more.