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.
So, give it a try. I haven’t got decent error reporting yet, so start with small simple files
There is still a lot of missing bits and corners cut, so please file issues.
I must have missed that somewhere in the readme/doc. The error message could use some love though.