3 ms·
What fundamental thing would change if Apple changed the foundation of their desktop OS to something other than Unix? Of all the things about Apple that could
by the_af 12y ago
What fundamental thing would change if Apple changed the foundation of their desktop OS to something other than Unix?
Of all the things about Apple that could be changed, I'd say the underlying technology of their OS is the least interesting.
- pjmlp 12y agoA desktop OS done in C++ instead of C. Database based filesystem. The way multi-core programming was present across whole OS.
- jff 12y ago> A desktop OS done in C++ instead of C. It's everything I could ever dream~ vomits uncontrollably
- the_af 12y agoC++ vs C is mostly irrelevant in my opinion. The other two are more substantial, but still seem pretty unimportant things to ask from Apple in an alternate reality. I'd say the problems with Apple are mostly non-technical.
- __david__ 12y ago> A desktop OS done in C++ instead of C. Which part? IOKit, for writing kernel drivers for Darwin's xnu kernel is C++. Cocoa is mostly Objective-C and not plain C. What would C++ improve there? So… which other part would redoing in C++ improve? The kernel filesystem layer? The internal kernel exec implementation? I'm not seeing what C++ brings to the table in any of these cases. Maybe the POSIX layer itelf? That could be new and interesting, but the C++ ABI isn't really compatible with much beyond C++ itself. The beauty of the C ABI is that pretty much everything implements it, some languages with direct C FFI APIs. Now a kernel written Rust… that's something I'd like to see. But then again, what would the userspace interface layer for such a kernel look like? POSIX?
- pjmlp 12y ago> Which part? IOKit, for writing kernel drivers for Darwin's xnu kernel is C++. Everything. > I'm not seeing what C++ brings to the table in any of these cases. Making C move out of the scene and moving into safer languages for systems programming. Even though C++ also has its issues, but at least it is way safer than C. There are C++ OS like Symbian, OS/400, Genode and also Windows is moving into that direction. However having a desktop OS to point out to as example, would be nice to the C++ community. > The beauty of the C ABI is that pretty much everything implements it, some languages with direct C FFI APIs. This is a consequence of C ABI being the OS ABI. Outside the UNIX world there are a few OS were this wasn't true. > Now a kernel written Rust… that's something I'd like to see. But then again, what would the userspace interface layer for such a kernel look like? POSIX? Me too. POSIX is tied to C, the API should be something modern.
- __david__ 12y ago> Making C move out of the scene and moving into safer languages for systems programming. Even though C++ also has its issues, but at least it is way safer than C. I guess I don't see as being "way" safer than C. I see it as being marginally safer [1], but with an arbitrary and rigid object model. > > The beauty of the C ABI is that pretty much everything implements it, some languages with direct C FFI APIs. > This is a consequence of C ABI being the OS ABI. Perhaps. But a non-OO interface layer makes a lot of sense anyway (or at least OO agnostic ones). The problem with making your main OS interface be C++ is that now every other language has to contort its object model to match the C++ one. How do you write Go code that interfaces with the C++ OS objects? C++ and Go are remarkably different. Ruby and C++ are different, as is Perl, Obj-C, Python, and Java. Either you have to use barely anything from C++ (really light inheritance, no STL, no RIAA, etc.) or you have to have extremely severe wrappers for every non-C++ language. The former means you give up on a lot of the safety that C++ gives you and the latter means that every language binding is 100% different. Neither of those is a good option. An idiomatic C++ OS interface sounds good on the surface, but I think it's really only a good idea if you want all the user code to be written in C++, too. [1] Everything you can do wrong in C you can also do in C++: Good old "((void(*)())0)();" compiles in both.