4 ms·
> There are plenty of operating systems that use C++ on the kernel side of things. Some things, like exceptions, are frowned upon and rarely used -- if at all -
by ahoka 9y ago
> There are plenty of operating systems that use C++ on the kernel side of things. Some things, like exceptions, are frowned upon and rarely used -- if at all -- but there is no shortage of C++ kernel code. Just not in Linux.
I used to work on one. It was developed in the 90s, around the same time C++ became an ISO standard. I think most of you have used it without knowing. :)
I think OOP is natural for writing kernels and most mainstream kernels implement some kind of object system because of this. I also wrote my toy kernel in modern C++, despite that I'm "fluent" in both C and C++. So yeah, C++ kernels are here, just not in Linux land.
- saagarjha 9y agoAre you referring to macOS?
- Cyph0n 9y agoI think the kernel itself is called Mach. Not sure if it was written in C++ though.
- sigjuice 9y agoThe kernel is called XNU. https://opensource.apple.com/source/xnu/ https://opensource.apple.com/source/xnu/ It is mainly written in C.
- self_awareness 9y agoThe BSD part of the kernel is written in C, but IOKit, the kext framework, is written in (a subset of) C++: http://xr.anadoxin.org/source/xref/macos-10.13-highsierra/xnu-4570.1.46/iokit/Kernel/ http://xr.anadoxin.org/source/xref/macos-10.13-highsierra/xn...
- ahoka 9y agoNah. Something from telco land.