Cpp2Rust: Automatically Translating C++ Code into Safe Rust

Cpp2Rust: Translates C++ to safe Rust automatically

18signa11💬 0
Cpp2Rust: Automatically Translating C++ Code into Safe Rust

I am building Cpp2Rust to automatically translate C++ code into safe Rust, helping developers modernize legacy systems without manual rewrites. The tool leverages Clang to parse C++ and generates idiomatic Rust, handling complex features like templates and control flow. Our goal is to make the transition to memory-safe languages seamless and accessible for everyone.

"Translating a label attached to a switch case from C++ to Rust requires refactoring all switch-analysing functions into a single struct to generate labeled blocks correctly."

More from this day · 2026-07-10