How could Rust improve?
How could Rust improve?
Posted Sep 1, 2024 15:10 UTC (Sun) by gmatht (subscriber, #58961)In reply to: Linux-for-Rust or Rust-for-Linux by johill
Parent article: Rust-for-Linux developer Wedson Almeida Filho drops out
Posted Sep 1, 2024 15:24 UTC (Sun)
by johill (subscriber, #25196)
[Link] (1 responses)
https://docs.kernel.org/kbuild/llvm.html#supported-archit...
And rust says:
https://docs.kernel.org/rust/arch-support.html
whereas the list of all architectures is currently
alpha, arc, arm, arm64, csky, hexagon, loongarch, m68k, microblaze, mips, nios2, openrisc, parisc, powerpc, riscv, s390, sh, sparc, um, x86, xtensa
So for something sufficiently core, you can't use rust.
I'm sure this will become better over time, but (IMHO) until it does there's a lot of stuff that's simply out of scope as I described.
Perhaps with the graphics driver(s?), NVMe driver and other things that have happened we should declare the rust experiment a success, and start focusing on the architecture story etc. (gccrs, code gen, whatever) so there can be hard dependencies. The extra dependency will probably still be hated by some (including some distributors perhaps), but at least it won't be a dependency that's literally impossible to satisfy.
I guess I just don't think it's fair to say it's all the fault of kernel maintainers, who are generally already overworked, have to support stuff on all architectures, have to (willing or not) learn a whole new thing, and then everyone says "oh but it works well for me so they're just being idiots." I mean, I guess we're used to being the scapegoats but still ... Both sides would do well with some empathy for the other side.
Posted Sep 3, 2024 13:14 UTC (Tue)
by gmatht (subscriber, #58961)
[Link]
BTW, rustc_codegen_gcc announced just over a year ago that they can now compile Rust-for-Linux. Informal benchmarks suggest it is 3% slower than regular rust.
I also had a look at mrustc. I was impressed that it could compile my rust code without issues, but it doesn't seem to support some essential things like
How could Rust improve?
I wasn't trying to criticize kernel developers. I was hoping that in addition to Linux better supporting Rust, Rust could better support Linux.rustc_codegen_gcc announced it could compile Rust For Linux.
#![no_main]. The resulting C can be 200x the size of the input rust, but it seems to shrink during compiling, and the compiled executable was smaller than the rust executable. I guess that is rust's static linking for you. I am not sure if this means mrustc-generated C would introduce excessive overhead.
