Re: [TECH TOPIC] Rust for Linux

Miguel Ojeda
2021-07-06T14:30:18Z

On Tue, Jul 6, 2021 at 11:55 AM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> AFAIU the idea is to replace an entire piece of code in C with the
> same piece in Rust, it's not like we are going to develop a second
> kernel in Rust inside the kernel in C. So both/and not either/or.
> I.e. you have to compile some pieces of the kernel written in
> Rust to even get to a working kernel.

Let me clarify this, since it is important: no, we are not replacing C
code In fact, the Rust side is based on the C one.

But that does not mean we are not rewriting a second kernel either --
for instance, we have red-black trees "abstracted" in the Rust side by
reusing C's API.

In other words, what we are doing is "abstract" the C APIs into Rust
APIs that can ensure as many invariants as possible statically, using
Rust facilities for that. Thus Rust is one more consumer of the C
APIs.

Cheers,
Miguel