On Wed, 2025-05-28 at 20:40 +0800, Yangtao Li wrote: > +cc rust-for-linux > > 在 2025/5/28 07:39, Viacheslav Dubeyko 写道: > > Hi Adrian, Yangtao, > > > > One idea crossed my mind recently. And this is about re-writing HFS/HFS+ in > > Rust. It could be interesting direction but I am not sure how reasonable it > > could be. From one point of view, HFS/HFS+ are not critical subsystems and we > > can afford some experiments. From another point of view, we have enough issues > > in the HFS/HFS+ code and, maybe, re-working HFS/HFS+ can make the code more > > stable. > > > > I don't think that it's a good idea to implement the complete re-writing of the > > whole driver at once. However, we need a some unification and generalization of > > HFS/HFS+ code patterns in the form of re-usable code by both drivers. This re- > > usable code can be represented as by C code as by Rust code. And we can > > introduce this generalized code in the form of C and Rust at the same time. So, > > we can re-write HFS/HFS+ code gradually step by step. My point here that we > > could have C code and Rust code for generalized functionality of HFS/HFS+ and > > Kconfig would define which code will be compiled and used, finally. > > > > How do you feel about this? And can we afford such implementation efforts? > > It must be a crazy idea! Honestly, I'm a fan of new things. > If there is a clear path, I don't mind moving in that direction. > Why don't try even some crazy way. :) > It seems that downstream already has rust implementations of puzzle and > ext2 file systems. If I understand correctly, there is currently a lack > of support for vfs and various infrastructure. > Yes, Rust implementation in kernel is slightly complicated topic. And I don't suggest to implement the whole HFS/HFS+ driver at once. My idea is to start from introduction of small Rust module that can implement some subset of HFS/HFS+ functionality that can be called by C code. It could look like a library that HFS/HFS+ drivers can re-use. And we can have C and Rust "library" and people can select what they would like to compile (C or Rust implementation). > I'm not an expert on Rust, so it would be great if some Rust people > could share their opinions. > > I hope that Rust people would like the idea. :) Thanks, Slava.