Developers trying to add Rust code to the Linux kernel continue to face opposition from kernel maintainers who believe using multiple languages is an unwelcome and risky complication.
Concerns surfaced last September when Microsoft software engineer Wedson Almeida Filho stepped away from the Rust for Linux project, citing frustration with “nontechnical nonsense” – which is one way to describe the difficulty of collaborating with those who have different goals.
Don’t force me to deal with your shiny language of the day. Maintaining multi-language projects is a pain
The issue flared again last month, when a proposed abstraction to allow Rust-written device drivers to call the primarily C-based kernel’s core DMA API met resistance from kernel maintainer Christoph Hellwig.
Specifically, a patch was submitted that would allow Rust drivers to use the DMA API’s dma_alloc_coherent()
C function to allocate and map large memory regions for direct memory access by hardware.
In a message to the Linux kernel mailing list, Hellwig wrote: “No Rust code in kernel/dma, please.” This is despite the patch adding code to the rust/kernel portion of the Linux source tree, not kernel/dma, as far as we can tell.
Miguel Ojeda of the Rust for Linux project asked Hellwig to suggest an alternative.
Hellwig replied: “Keep the wrappers in your code instead of making life painful for others,” and went on to argue that “interfaces to the DMA API should stay in readable C code and not in weird bindings so that it [remains] greppable and maintainable.” Hellwig’s wish seems to be that non-C drivers have their own private bindings to C code, and that these are not maintained separately, not even in the rust/kernel tree.
Challenged by Danilo Krummrich, a Red Hat software engineer involved in the Rust for Linux project, Hellwig makes clear that he’s just not keen to deal with Rust code.
“Don’t force me to deal with your shiny language of the day,” he wrote. “Maintaining multi-language projects is a pain I have no interest in dealing with. If you want to use something that’s not C, be that assembly or Rust, you write to C interfaces and deal with the impedance mismatch yourself as far as I’m concerned.”
In response, Krummrich explained the Rust for Linux effort is creating Rust code that abstracts the C API for all Rust drivers and is maintained