Skip to main content

Is Rust a quasi-religious cult?

Some years ago advocates of the Rust programming language started very strongly pushing the idea of adding support for it in the Linux kernel source code. For reasons unknown, the creator and owner of the kernel project, Linus Torvalds, made a surprise move and actually accepted that idea. (This is very surprising because over the past 30 years Torvalds has summarily rejected, sometimes very aggressively, literally dozens of other programming languages that have been suggested for the kernel, several of which would have been perfectly adequate for it. It's unclear why he suddenly decided to make an exception with this particular one, out of literally dozens.)

The Rust advocates have already started replacing perfectly valid and working pieces of C code in the kernel with Rust versions. In most cases there's no reason for the switch, other than changing it for the sake of changing it and nothing else, as in most cases the original C code has been battle-tested for literally decades and confirmed to be working, robust, safe and bug-free.

In other words, they are engaging in a huge amount of violations of the "if it works, don't fix it" principle.

And what do you know, when you start changing existing bug-free code with a completely new implementations, the new implementations sometimes introduce bugs that weren't there originally.

Recently, one such particularly nasty bug was introduced in such a piece of Rust code that was written to replace (completely working and bug-free) C code. Said bug caused a memory corruption that caused the kernel to crash in certain situations.

The huge irony here is that Rust is being promoted as "memory safe" and its advocates are literally claiming that you can't have memory violation problems in Rust, and pretty much "if it compiles, it works". Thus, the irony is palpable when the piece of Rust code caused a memory corruption problem. It's rather egregious because the original C code did not have such a problem and was demonstrably robust and bug-free.

One of the top brass of the kernel development project made recently a post about the bug in the official Linux kernel development forums:


Many commenters have noted the kind of language he is using there. Rather than just write an announcement about the bug in a straightforward dry matter-of-fact manner, his post is clearly extremely defensive.

He clearly felt the need to start the post by singing praises to the language and defend the choice of adding support for it. Then he gives a link to the bug report, but immediately feels the need to soften the blow by giving an assurance that it "just causes a crash, not the ability to take advantage of the memory corruption", which, according to him, is somehow "a much better thing overall"!

So yeah, "sure, there might have been a memory corruption bug in this memory-safe perfect language, which causes a crash of the kernel, but it's not that bad! It's still a better thing overall!"

And to further ameliorate the possible bad rep that the announcement might cause, he immediately follows it with a reminder that the existing C portion of the code also has existing bugs!

Many commenters have noted the sheer amount of defensiveness and excuses in this announcement, which would otherwise normally have been just a very direct and dry matter-of-fact post.

Most of these commenters also surmise that he is not being this defensive just because of his personal opinions of the language. Rather, he is being this defensive as a protection mechanism against the reaction of the Rust cultists.

You see, it appears to be extremely common that if you express any criticism of the language in the Rust circles, no matter how mild, no matter how indirect, no matter how much implied (not to talk about outright directly criticizing it), you will get a barrage of vicious verbal attacks. The Rust cultists will become a horde of zealots attacking you for daring to criticize the Holy Rust.

It is somewhat likely that Greg there, one of the top maintainers of the Linux kernel, didn't make such an egregiously defensive post just because he likes the language, but to try to protect himself from the rage of the cultists who will absolutely and categorically not tolerate any criticism or badmouthing of their beloved language.

I have not checked (not enough interest from my part) if various Linux kernel and Rust forums are now stock full of copium about this particular bug, but I would not be surprised. I bet there are by now hundreds of equally and even more defensive posts in those forums.

Comments