Canonical and University of Bristol to Automate C to Rust Migration
A three-year PhD project will use neurosymbolic AI to safely translate legacy C codebases into memory-safe Rust.
Canonical has partnered with the University of Bristol to fund a three-year PhD project designed to increase the rigour of automated C to Rust translations. The initiative, which receives matched support from UK Research and Innovation (UKRI), aims to develop an end-to-end platform capable of converting large C repositories into maintainable, behaviourally correct, and safe Rust code.
Led by Professor Meng Wang at the University of Bristol, the research is co-supervised by Dr. Cristina David and a representative from Canonical. The project will be carried out by PhD student Alex Wood, who brings expertise in low-level security, Rust, and compiler construction. To test the platform against mature, security-critical production software, the team will use snap-confine and AppArmor as primary industrial case studies. The ultimate goal is to build a system capable of translating repositories containing hundreds of thousands of lines of C code.
The Neurosymbolic Approach
Modernizing legacy C codebases is traditionally a high-risk and expensive endeavor. Manual rewrites often lead to the loss of critical performance optimizations and operational knowledge. While Rust provides significant memory-safety advantages for systems programming, the massive volume of existing C code remains a primary barrier to widespread adoption. Canonical has already integrated some Rust-based alternatives, such as sudo-rs and uutils coreutils, but requires a more scalable method for migrating critical systems software.
To solve this, the project employs a "neurosymbolic" architecture that combines the generative power of large language models (LLMs) with the precision of formal program analysis. The proposed pipeline consists of four distinct stages: Scheduling, which handles repository partitioning; Translation, powered by LLMs; Validation, utilizing formal equivalence checking and fuzzing; and Debugging/Repair, which employs symbolic program-repair techniques. This structure addresses the inherent unreliability of AI-generated code; generated code must be treated as untrusted until there is evidence that it preserves the desired behaviour.
Industry Implications
If successful, this research could fundamentally lower the cost and risk associated with migrating critical infrastructure to memory-safe languages. By moving away from simple source-to-source translation and toward a verified pipeline, the industry could systematically eliminate entire classes of memory-safety vulnerabilities in legacy software without the prohibitive expense of manual labor.
What's Next
The project now moves into the implementation phase, focusing on the integration of LLM translation with formal validation tools. Observers will be watching how the platform handles the complexities of AppArmor and snap-confine, as these case studies will determine if the neurosymbolic approach can scale to the demands of production-grade security software.