@Tim_Roberts said:
… but because Linus Torvalds is personally allergic to C++.
To C++ in its state when Linux was founded. That’s C++ 98 or older, and it was then not a clear winner over C (with extra tools).
and they use macros to simulate the kinds of data structures that are easy in C++.
But the C++ data structures are in its standard library, and this library is written in assembly or C.
This library is part of the kernel, it needs to be build for kernel environment, reviewed and maintained.
There’s no miracles. It is made of extra memory and CPU cycles. Every time one uses a C++ thing in kernel, they cannot avoid thinking: will it do a trick under the covers: allocate something? execute something? could it be easier and safer to just use plain C with macros?
By contrast, structures in python or js are magical, one can use them without importing anything and even knowing what’s the name of or {}.
Of course this magic is expensive and doesn’t fit in the kernel. But every time I write something in python - after years of C - I smile (and thank you, Mr, Roberts again for hinting me to learn python!)
– pa