HeadlinesBriefing favicon HeadlinesBriefing.com

Canonical Funds C-to-Rust Translation Research Project

Hacker News •
×

Canonical is backing a new three-year research project aimed at making it practical to automatically translate large, mature C codebases into safe Rust. The initiative is a collaboration between Canonical and the University of Bristol in the UK, with work expected to begin later in 2026.

The project's primary objective is to develop a complete platform capable of translating large code repositories—often containing hundreds of thousands of lines of C—into safe, reliable, and maintainable Rust. The challenge lies in the vast amount of legacy C software still in use; manually rewriting such code is costly and risky, given years of accumulated fixes and optimizations.

Current source-to-source translators only partially solve the problem. While they can handle large volumes of code, they often replicate C structures too closely, resulting in Rust that still depends on unsafe features. LLMs, meanwhile, excel at generating idiomatic Rust for small code snippets but struggle with the broader context of entire repositories.

To overcome these hurdles, the project will employ a hybrid, or 'neurosymbolic,' approach, combining machine learning with traditional program analysis, testing, and formal methods. Canonical plans to use AppArmor and snap-confine as real-world case studies. The initiative also aligns with Canonical's broader adoption of Rust within Ubuntu, as seen in projects like uutils coreutils and sudo-rs.