Re: [TECH TOPIC] Rust for Linux

Linus Walleij
2021-07-05T23:51:24Z

On Sat, Jun 26, 2021 at 12:09 AM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:

> The Rust for Linux project is adding support for the Rust language to
> the Linux kernel. This talk describes the work done so far and also
> serves as an introduction for other kernel developers interested in
> using Rust in the kernel.

I think this is a good tech topic.

I think one thing that need discussing around this is implementation
language fragmentation and brainshare: kernel developers are all
assumed to grasp C, assembly, Make, KConfig, bash and some
YAML, perl and python here and there. I bet there is some sed
and awk in there and possibly more.

So, admitting how lazily we sometimes learn languages, which is
by copying, pasting and tweaking, then when that doesn't work
actually looking at the language spec (or StackOverflow) how hard
is that going to be with Rust? We get the hang of it quickly, yes?

I also repeat my challenge from the mailing list, which is that
while I understand that leaf drivers is a convenient place to start
doing Rust code, the question is if that is where Rust as a language
will pay off. My suggestion is to investigate git logs for the kind of
problems that Rust solves best and then introduce Rust where
those problems are. I believe that this would make be the
Perfect(TM) selling point for the language in the strict
hypothetico-deductive sense:

Hypothesis: Rust solves kernel problems A,B,C.

Collect occurrence data about problems A,B,C from git logs.

Identify code sites often exposing problems A,B,C.

Rewrite those in Rust.

Demonstrate how the Rust code now elegantly avoid
ever seeing problems A,B,C again.

From this it is very easy for the kernel community to deduce that
introducing Rust as an implementation language is worth it.

Yours,
Linus Walleij