Re: C aggregate passing (Rust kernel policy)

Theodore Ts'o
2025-02-24T12:58:38Z

On Sun, Feb 23, 2025 at 08:30:06AM -0700, Ventura Jack wrote:
> Rust aliasing:
> - Is not a keyword.
> - Applies to certain pointer kinds in Rust, namely
> Rust "references".
> Rust pointer kinds:
> https://doc.rust-lang.org/reference/types/pointer.html
> - Aliasing in Rust is not opt-in or opt-out,
> it is always on.
> https://doc.rust-lang.org/nomicon/aliasing.html
> - Rust has not defined its aliasing model.
> https://doc.rust-lang.org/nomicon/references.html
> "Unfortunately, Rust hasn't actually
> defined its aliasing model.
> While we wait for the Rust devs to specify
> the semantics of their language, let's use
> the next section to discuss what aliasing is
> in general, and why it matters."

Hmm, I wonder if this is the reason of the persistent hostility that I
keep hearing about in the Rust community against alternate
implementations of the Rust compiler, such as the one being developed
using the GCC backend. *Since* the aliasing model hasn't been
developed yet, potential alternate implementations might have
different semantics --- for example, I suspect a GCC-based backend
might *have* a way of opting out of aliasing, much like gcc and clang
has today, and this might cramp rustcc's future choices if the kernel
were to depend on it.

That being said, until Rust supports all of the platforms that the
Linux kernel does has, it means that certain key abstractions can not
be implemented in Rust --- unless we start using a GCC backend for
Rust, or if we were to eject certain platforms from our supported
list, such as m68k or PA-RISC....

- Ted