3 ms·
That argument isn't nearly as persuasive in kernel space as it is in user space. Certainly not when performance and bleeding-edge techniques (orthogonal to or e
by wahern 8y ago
That argument isn't nearly as persuasive in kernel space as it is in user space. Certainly not when performance and bleeding-edge techniques (orthogonal to or even in opposition to the normal idiomatic patterns newer languages emphasize and optimize) are as emphasized as they are in Linux. How many bespoke hash, tree, and queue data structures exist in the Linux kernel, each with purposeful but complex data and execution flow dependencies unique to their context? Every time someone tries to unify two, one more pops up. Point being, the Linux development model--partly because of the nature of the work, partly because of the particular culture--absolutely defies attempts at drawing lines between safe and unsafe so the latter can be isolated. Code that doesn't heavily rely on unsafe techniques, directly or indirectly, wouldn't normally be in the kernel, anyhow.
And particularly in a kernel environment even @safe code can do things that violate or exacerbate assumptions elsewhere in the code (e.g. complex RCU protocols), thus Linus' preference to avoid languages with a lot of implicit machinery or non-obvious execution flow. So it's not like @safe code can simply be removed from the equation.