Corrode is an experimental translator that converts C code into Rust, intended to help migrate existing C codebases toward safer Rust idioms. It parses C, maps C types and constructs into Rust equivalents, and generates code that compiles under rustc, introducing unsafe only when necessary. The tool seeks to produce readable Rust that a developer can then refine by hand, rather than a perfect one-to-one mechanical translation. It handles common C features such as pointers, structs, enums, arrays, and function calls, while flagging areas that need attention during the migration. Preprocessor handling and tricky macro patterns are approached pragmatically, aiming for working output over exhaustive transformation. As a proof-of-concept, it demonstrates how automated tooling can accelerate moving from legacy C to a memory-safe language without a full rewrite.

Features

  • Parsing of C source code (AST)
  • Translation of C constructs (variables, functions, control flow) into Rust syntax
  • Handling pointer arithmetic, memory operations, and C idioms
  • Generation of Rust code preserving semantics
  • Tooling to assist in incremental porting rather than full rewrite
  • Ability to map C standard library constructs or external dependencies

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

GNU General Public License version 3.0 (GPLv3)

Follow Corrode

Corrode Web Site

Other Useful Business Software
Forever Free Full-Stack Observability | Grafana Cloud Icon
Forever Free Full-Stack Observability | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Corrode!

Additional Project Details

Programming Language

Haskell

Related Categories

Haskell Libraries

Registered

2025-09-26