Re: [TECH TOPIC] Rust for Linux

Laurent Pinchart
2021-07-06T15:43:04Z

On Tue, Jul 06, 2021 at 05:33:42PM +0200, Miguel Ojeda wrote:
> On Tue, Jul 6, 2021 at 5:03 PM Sasha Levin <sashal@kernel.org> wrote:
> >
> > Does this mean that anyone who wishes to modify these C APIs must also
> > know Rust to fix up those abstractions too?
>
> Please see my answer to James and Leon, i.e. if we have abstractions
> for a particular subsystem, it should mean somebody is happy to write,
> use and maintain them.

There are lots of core APIs that are used by most drivers and that are
not subsystem-specific, so those will need to be considered too.

Additionally, even if there's a subsystem maintainer willing to maintain
a Rust abstraction, it also means that someone doing tree-wide or
subsystem-wide refactoring will need to pull the maintainer(s) in and
make it a team project. I really don't see how that can scale, tree-wide
changes are already very painful.

> That means that, yes, for subsystems that have Rust abstractions, if
> you want to touch the C API, you also need to do so for the Rust
> abstractions. But for any heavy refactor, I would expect maintainers
> being the ones doing it, or at least helping to do so if somebody else
> wants to change something in the C side and does not know how to
> update the Rust side.

I'm afraid that doesn't really match how development is done today :-)
Lots of subsystem-wide refactoring is done by developers who are not
subsystem maintainers.

--
Regards,

Laurent Pinchart