Re:C for All
by pjmlp on Friday March 23, 2018 @12:47PM
(#16659994)
Because most UNIX kernel devs are religiously against the idea of ever touching C++, even if their beloved C compilers are implemented in C++.
[ Parent
| on HN ]
I highly suspect it's not that Unix C diehards are against the idea of touching C++βit's that they're against the idea of using anything but C. I don't think anything can win over those kernel developers.
Its the complexity of the language vs the benefits it provides. C has many pitfalls (UB) but its simple. IMO a language that could migrate C programmers would have dependent types and an effect system with a nice syntax.
Idris?
It can compile small enough to run on an Arduino: https://github.com/stepcut/idris-blink
Yep you are quite right.
Other OSes not tied to UNIX culture were always more open to reach out for C++, even if constrained to a certain subset.
Using a compiler partially written in c++ is very different from writting and mantaining a kernel (or whatever) in c++.
Re:C for All
by nickpsecurity on Friday March 23, 2018 @06:59PM
(#16663395)
Maybe. The L4 people did write one of theirs in C++. L4-style kernrls are among the fastest in existence. Some even fit in the L1 cache of the CPU.
http://www.l4ka.org/projects/pistachio/pistachio-whitepaper....
I can see your point if you're saying compiler use lets them avoid a language they just dont want to use. Which they couldnt if using it for an OS.
Other OSes, not impregnated with UNIX culture, have a different view on C++'s use on kernel space.
OS X and its descendents is the only exception.
Which goes back to NeXTSTEP using Objective-C and offering UNIX compatibility only as a path to bring software into the system, battling against SGI and Sun market space.
Even OS X's C++ usage is kind of a historical oddity. OPENSTEP drivers were written in ObjC for an API called DriverKit, but OS X/Darwin/xnu replaced that with the C++ IOKit. The rest of the kernel is still C. I wrote a comment a few years ago explaining why I think that decision was made: