I’d like to announce a tool that’s meant to help rewriting C codebases in Rust. It’s a source to source translator: it takes a C file and produces roughly the same code with Rust syntax.
Unlike Corrode it doesn’t even try to preserve correct C semantics, so the generated code won’t even compile until type errors and C-isms are fixed manually.
The goal here is to produce readable code that’s a starting point for refactoring. Citrus helps with the boring syntax conversions when you’re manually converting a C codebase to Rust bit by bit. For example, you may be able to copy&paste some C expressions, loops, or small functions to Rust without having to manually correct
type var to
var: type over and over again.
It’s like bindgen, but also includes function bodies.
See also another project (not mine): https://c2rust.com/