4 ms·
Immunant folks wrote a blog post [1] about automating conversion of Linux kernel drivers from C to Rust by using their tool c2rust[2]. [1] https://immunant.com
by xvilka 6y ago
Immunant folks wrote a blog post [1] about automating conversion of Linux kernel drivers from C to Rust by using their tool c2rust[2].
[1] https://immunant.com/blog/2020/06/kernel_modules/ https://immunant.com/blog/2020/06/kernel_modules/
[2] https://github.com/immunant/c2rust https://github.com/immunant/c2rust
- yjftsjthsd-h 6y agoI don't see them discussing what I view as the biggest question of such conversion: is the converted code safer than C, or is it a direct translation with all the issues that we were trying to fix by using Rust? (This came up, IIRC, with automatic C to Go; it worked, but was only useful as a first step because it gave you unsafe unidiomatic Go code)
- steveklabnik 6y agoIt is currently a direct translation into unsafe. They are also interested in "unsafe to safe refactoring tools" in my understanding, but they're not there yet.
- xvilka 6y agoThere is a good refactoring tool[1][2] to automate the process. It also allows scripting in Lua[3]. [1] https://github.com/immunant/c2rust/tree/master/c2rust-refactor https://github.com/immunant/c2rust/tree/master/c2rust-refact... [2] https://c2rust.com/manual/c2rust-refactor/commands.html https://c2rust.com/manual/c2rust-refactor/commands.html [3] https://c2rust.com/manual/c2rust-refactor/doc/scripting_api.html https://c2rust.com/manual/c2rust-refactor/doc/scripting_api....
- steveklabnik 6y agoOh awesome! Thank you!