TechNewsReel
Live

Canonical funds AI research to automate C-to-Rust migration for legacy code

A three-year PhD project at the University of Bristol will test if LLMs can rewrite mature C codebases into safe Rust without relying on literal translation.

TechNewsReel Newsroom · August 24, 2026

Canonical is co-funding a three-year PhD research project at the University of Bristol to determine if artificial intelligence can translate massive, mature C codebases into safe and maintainable Rust. The initiative seeks to automate the modernization of critical infrastructure by leveraging large language models (LLMs) to rewrite legacy code.

Conducted within the University of Bristol's Programming Languages Research Group, the project is co-sponsored by UK Research and Innovation (UKRI), which is funded by the UK's Department for Business, Innovation, Science and Trade. The research will specifically focus on the translation of snap-confine and AppArmor. The effort is overseen by Canonical's VP of Engineering Jon Seager, alongside Professor Meng Wang and Dr. Cristina David.

Moving beyond literal translation

The project aims to solve a persistent problem with traditional source-to-source translators. According to Jon Seager, these tools often preserve C structures too literally, producing Rust code that compiles but relies heavily on unsafe operations and retains awkward C idioms. Seager noted that such results often require significant manual intervention before they resemble code a Rust maintainer would actually want to own.

To avoid these pitfalls, the research will investigate using LLMs to decompose large programs into smaller, manageable components before rewriting them. This approach is designed to preserve the "hidden knowledge"—the undocumented bug fixes and corner-case handling—that typically accumulates in mature C code over decades, which is often lost during manual rewrites or rigid automated translations.

The push for memory safety

This research follows a broader trend of integrating Rust into the Ubuntu ecosystem. Canonical has already demonstrated its commitment to the language by adopting human-written Rust implementations of sudo and uutils coreutils in Ubuntu 25.10. However, manually replacing hundreds of thousands of lines of code is often prohibitively expensive and risky for most organizations.

If successful, this AI-driven methodology could drastically reduce security vulnerabilities associated with memory-unsafe languages like C. By automating the migration of critical system components to Rust, the industry could eliminate entire classes of memory-related bugs without the unsustainable cost of manual rewriting.

Future outlook

As the three-year study progresses, the primary goal will be to prove that AI can handle the complexity of real-world system tools like AppArmor while maintaining the strict safety guarantees that make Rust desirable. The project's outcome will determine whether AI can realistically bridge the gap between legacy C infrastructure and modern memory-safe standards at scale.

Sources

Get a notification when a big story breaks. A few a day at most — no spam.