Canonical backs quest to translate mountains of C into safe Rust with AI
Canonical is co-funding a three-year PhD project at the University of Bristol to investigate whether AI can translate large C codebases into safe, idiomatic Rust. Announced by engineering vice-president Jon Seager on Ubuntu's Discourse forum, the project is a research effort rather than a plan to rewrite Ubuntu wholesale, and aims to produce evidence on whether AI-assisted translation can genuinely work, in contrast to existing source-to-source tools that tend to preserve C's structure too literally and leave code reliant on unsafe operations.
The research will explore whether an LLM can break programs of "hundreds of thousands of lines of C" into smaller components before rewriting them into "safe, behaviourally correct and maintainable Rust," with snap-confine and AppArmor named as candidate test cases. Canonical is co-sponsoring the work with UK Research and Innovation, and Seager will oversee it alongside Bristol's Professor Meng Wang and Dr Cristina David. This differs from Canonical's earlier Rust moves, such as adopting the pre-existing sudo-rs and uutils projects in Ubuntu 25.10, since those were human-written rewrites rather than AI-generated translations.
- Canonical co-funds Bristol PhD on AI-driven C-to-Rust translation
- Three-year project, backed with UK Research and Innovation funding
- Targets snap-confine and AppArmor as initial test cases
New here? Start with this
C is a programming language used in many long-standing systems, including parts of Linux. Rust is a newer language designed to prevent certain common memory errors, though converting a large C program into Rust can be difficult because the new version must still behave as the old one did.
Canonical develops Ubuntu, a widely used version of Linux. Its earlier adoption of Rust versions of tools such as sudo and core utilities involved projects written by people; this research instead asks whether AI can help translate larger C programs while making the resulting code safer and easier to maintain.
The University of Bristol team will study how to divide large programs into smaller parts for translation and compare the results with existing approaches. Candidate examples include snap-confine, which helps run Snap applications, and AppArmor, a Linux security system; the findings could help clarify where AI-assisted translation is practical and where it falls short.
Both sides, in good faith
The strongest fair case each way — we don't pick a winner.
The case for
C's memory-safety vulnerabilities represent a persistent security problem in critical infrastructure. If AI-assisted translation can produce safe, idiomatic Rust from large codebases, this could offer a practical path to significantly improve security where complete manual rewrites are impractical. The research is appropriately framed as exploratory, generating evidence about feasibility rather than committing to wholesale replacement.
The case against
Applying automated translation to safety-critical systems introduces real risks. C and Rust have fundamentally different design philosophies and memory models; existing source-to-source tools struggle to produce idiomatic code, and AI translations could generate plausible implementations that contain subtle but serious errors—particularly concerning in security modules like AppArmor. Resources might more reliably improve security through careful manual rewrites, enhanced testing, or complementary security measures.