3 ms·
Given that busybox is structured as one function per command int COMMAND_main(int argc, char **argv) and that it's compilable as a library already, I wond
by wrs 7y ago
Given that busybox is structured as one function per command
int COMMAND_main(int argc, char **argv)
and that it's compilable as a library already, I wonder if it would make more sense to use bindgen or the like to start with the actual busybox C code, but with a (trivial) Rust main function. You'd have the current busybox source compiling an ever-smaller library, and a Rust lib next to it. Then move things over to the Rust side one command at a time.
- skainswoo 7y agoI've actually thought about doing this. There are some "applets" that are just so complex or have so many gotos that I really don't want to touch the rust code any more than I want to touch the C code, so it may make sense to take this route with them in the future.