4 ms·
Linus objected to C++ partly because it has far too much implicit allocation. If you look at how much surgery is required to make the Rust for Linux alloc work
by tialaramex 4y ago
Linus objected to C++ partly because it has far too much implicit allocation.
If you look at how much surgery is required to make the Rust for Linux alloc work you can see he was quite serious. For example Rust for Linux Vec::push doesn't exist, because if the Vec wasn't big enough that's an implicit allocation, instead Vec::try_push is provided, which is fallible.
There was nobody proposing to even attempt that kind of work for C++.
- gpderetta 4y agoLinus refuses to use C++ because he literally believes us C++ programmers are subhumans. I don't think his position is entirely rational (and, understand, I have otherwise huge respect for him as an engineer).
- account42 4y agoC++ doesn't have any implicit allocation. The standard library does but that is no-go for the kernel anyway. Doesn't preclude using templates, classes and other C++ features in the kernel - and some external proprietary drivers already do.