5 ms·
Be's use of C++ (at the kernel/library API/ABI level) would have doomed it in the long term IMHO. There have been several incompatible C++ ABI bumps since then
by phs2501 9y ago
Be's use of C++ (at the kernel/library API/ABI level) would have doomed it in the long term IMHO. There have been several incompatible C++ ABI bumps since then, all of which would have broken compatibility. See the current Be clones which still have to use an ancient version of GCC to not break compatibility with existing software.
NeXT's ABI interfaces (C and ObjC) were and are much more stable.
(I'm not saying don't use C++, just don't use C++ and expect a stable binary API. You need to wrap it in a C API instead unfortunately. There's too much magic in C++ to have a stable ABI and still be able to evolve the language.)
- twoodfin 9y agoThis is a great point. I understand why a C++ ABI is so hard to keep nailed down, but the inability to do so has really hampered adoption of C++ as a true “system” language.
- pjmlp 9y agoMany OSes written in C++ beg to differ. C ABI only happens to exist on OSes written in C, thus having a C ABI at all. NeXT used Objective-C on its drivers framework, and that was replaced by a C++ subset in IO Kit. Likewise their Metal shaders are based on C++14. Microsoft has been slow and steady migrating their code into C++ since Vista. https://www.reddit.com/r/cpp/comments/4oruo1/windows_10_coded_in_c_or_assembler/d4g9we9/ https://www.reddit.com/r/cpp/comments/4oruo1/windows_10_code... Symbian, GenodeOS, includeOS, mbed are all written in C++. IBM mainframes were written in PL/I dialects, like PL/S and PL/8, and new code is written in C++. ChromeOS is written mostly in C++, even if it exposes only Web APIs. Most of Android native libraries are written in C++. Of course on ChromeOS and Android, C is still there given the Linux kernel.
- pavlov 9y agoYou're missing the point. The problem isn't using C++ internally in the OS -- it's exposing public C++ APIs. Because there's no stable ABI, that creates a dependency on the specific compiler. That's exactly what happened to BeOS and Symbian. Both were stuck at GCC 2.95 for many years after mainline GCC was already at version 4.x. There's a ton of C++ in macOS/iOS, but it's wrapped to plain C for the public userland APIs.
- pjmlp 9y agoWhat happened to BeOS and Symbian was dying before gcc 4.x, released in 2007, became relevant. Nothing to do with C++ ABI. Other C++ OSes are doing pretty ok.
- pavlov 9y agoSymbian wasn't dead in 2007. It was the world's leading smartphone OS and shipped in tens of millions of devices yearly. Symbian's inability to upgrade the platform to modern compilers definitely was one factor in its failure to gain developer mindshare, and the C++ ABI was the reason for that. They had painted themselves into a corner with a '90s C++ embedded dialect and had no easy way forward. I'm curious -- which modern OS exposes a C++ API and is "doing pretty ok"? I can't think of any.