An automatic semantics-preserving translator that converts C source code into equivalent Rust syntax.
Corrode is an automatic translator that converts C source code into semantically equivalent Rust syntax. It helps developers migrate legacy C codebases to Rust by preserving the original behavior and ABI compatibility, though the output requires manual cleanup to adopt Rust idioms.
Developers and teams maintaining legacy C codebases who want to migrate to Rust incrementally, or those exploring automated translation for research or tooling purposes.
Corrode provides a reliable, semantics-preserving foundation for C-to-Rust migration, ensuring ABI compatibility and structural fidelity, which reduces manual rewriting effort and maintains link compatibility with existing C binaries.
C to Rust translator
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Generates Rust code that behaves identically to the original C if free of undefined behavior, with extern 'C' modifiers ensuring link compatibility with C binaries.
Accepts GCC compiler flags like -I and -D, and includes corrode-cc script to replace gcc in makefiles, enabling seamless integration into existing workflows.
Maintains the original code structure and statement order, making the output recognizable and easier to maintain during migration.
Automates the initial translation step for large legacy codebases, reducing manual rewriting effort while preserving behavior.
The generated Rust code lacks Rust idioms and safety features, requiring significant manual cleanup—a gap the README acknowledges with plans for a separate 'idiomatic' tool.
The project is in early phases and admits it cannot translate most real C programs, relying on contributions to implement more language features.
No pre-built binaries are available; users must build from source using Haskell tools like Cabal or Stack, which adds overhead and potential environment issues.