Re: [TECH TOPIC] Rust for Linux

Johannes Berg
2021-07-06T19:39:46Z

On Tue, 2021-07-06 at 16:30 +0200, Miguel Ojeda wrote:
>
> 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.

I couldn't really find a good place too hang this question, so it's here
now ;-)

Mostly from what I've seen you've been talking about rust being the
'leaves' in the graph, in the sense that it consumes C APIs exposed by
the kernel elsewhere, etc. In drivers using things, for example.

How about the other way around? What if we'd want to slowly replace
(parts of) a subsystem with rust code, but leave drivers? Or let's say
write some data structures in rust because of the stated benefits, but
let C consumers exist?

johannes