Rust is slated to play a huge part in Ubuntu’s future. As a language that allows programmers more control over resource use and performance as well as removing many classes of memory safety issues, it’s an especially good choice for building security-sensitive software.

But modernizing huge amounts of the legacy C code that currently powers the Linux operating system has been, and continues to be, a major challenge.

“Rewrites have long been expensive and risky, and do not often materialize obvious improvements. Established codebases often contain years of bug fixes, compatibility decisions, operational knowledge, and hard-won performance optimizations,” Jon Seager, VP engineering at Canonical wrote In a blog post on Wednesday. “If we want more systems software to benefit from memory safety, we need better ways to reduce the cost and risk of migration.”

To that end, Canonical, along with UK Research and Innovation, is funding a three year PhD project to create a platform that will translate hundreds of thousands of lines of C code into Rust. The project will be led by Professor Meng Wang, with Seager and Dr. Cristina David as co-supervisors of PhD student Alex Wood.

It’s not as easy as it may sound, Seager wrote. “Traditional source-to-source translators can process substantial amounts of code, but often preserve the structure of the C too literally. The result may compile as Rust, but still rely heavily on unsafe operations, retain awkward C idioms and require significant manual work before it resembles code a Rust maintainer would choose to own.”