3 ms·
C++ is insecure in memory and has infinite unexpected behavior. Rust, on the other hand, does not compare with it, as it is safe. Linus doesn't like C++ because
by claudiojulio 4y ago
C++ is insecure in memory and has infinite unexpected behavior. Rust, on the other hand, does not compare with it, as it is safe. Linus doesn't like C++ because it sucks.
- kcexn 4y agoIf I recall correctly, Linus doesn't like C++ because it introduces abstractions that take control away from the programmer and delegates it to the compiler. Over time this just reduces the performance of the kernel, and makes it harder to find the root cause of faults and bugs.
- sph 4y agoIn a parallel universe where Linus learns Rust, I can imagine many legendary rants where a new kernel developer tries to be smart with some obscure macro and then getting summarily shot down by him. Yeah, Linus doesn't like C++ because of the abstractions and complexity, which Rust doesn't save us from. He'd rather have a less secure but simpler (and more widespread) language. That said, it's great of him to stay open minded and opening the doors to Rust in the mainline tree.
- kcexn 4y agoI think he's always been OK with C++, Python, Rust etc., for tooling around the kernel. But found that for the kernel itself, the performance and reliability guarantees were strict enough that he didn't want to risk there being performance or reliability issues caused by the compiler. Performance/reliability issues caused by programmers can be found and rectified. Performance issues caused by compilers may not be replicable even between builds.