liquidctl / liquidtux

Linux kernel hwmon drivers for AIO liquid coolers and other devices
Other
79 stars 14 forks source link

Migrate to Rust #59

Open stalkerg opened 9 months ago

stalkerg commented 9 months ago

Why?

  1. It is just for a discussion.
  2. Educate how kernel Rust is working.
  3. liquidtux is small enough to create such a migration without too much effort.
  4. We already have some race condition challenges maybe Rust can simplify them.
  5. Just-for-fun, hype

It's not a proposal I just want to hear your opinion. For me the main obstacle it's the lack of GCC support (yet) and in that case, we must build kernel by llvm.

Regards,

aleksamagicka commented 9 months ago

I couldn't care less what compiler is being used, as long as it's not a PITA to configure and carry on.

I'll admit that I'm not completely up to speed with where the kernel stands with Rust right now, but I certainly don't want to be the one trying to upstream any glue code for hwmon :) Perhaps this doesn't make sense at all, or it's not needed, but you get the idea.

And I don't think it's a good idea to drop the current C drivers and just switch to Rust. If the option to use Rust becomes available, then I'd prefer that only new drivers be written in it (if the author/s want). Maintaining both versions in principle is a pain and I don't think upstream would be very happy to get a patch replacing C with Rust just for fun.

IOW, I'm not against Rust. I'm all in for new tech etc, but my opinion is that it's too early. And personally I'd like to see a complete example of a hwmon Rust driver that can compile, be inserted etc and what modifications to the kernel were needed to get there.

stalkerg commented 9 months ago

And I don't think it's a good idea to drop the current C drivers and just switch to Rust. If the option to use Rust becomes available, then I'd prefer that only new drivers be written in it (if the author/s want). Maintaining both versions in principle is a pain and I don't think upstream would be very happy to get a patch replacing C with Rust just for fun.

Yeah, I agree.

And personally I'd like to see a complete example of a hwmon Rust driver that can compile, be inserted etc and what modifications to the kernel were needed to get there.

seems like a better way to understand it would be to try to make a dummy driver with fake indicators, but I don't think it will be too much of a problem if even DRM bonded already and the Apple GPU driver works very well.