Software has a safety problem. Billions of lines of code run the world's banks, power grids, cars, and phones, and much of it was written in languages that make it easy to introduce hidden bugs and security holes. For years, the answer has been to rewrite critical systems in Rust, a modern language designed to prevent entire classes of errors. That movement is called "Rewrite It In Rust," or RIIR. Now a new presentation, titled RIIIR: Rewrite It In *Idiomatic* Rust (with AI), points to the next step: using artificial intelligence to not just translate code, but to rewrite it the way a seasoned Rust developer would.
The title may sound like a niche engineering talk, but it captures a much bigger shift. AI is moving from writing small snippets of code to performing large-scale, high-stakes software modernization. If that works, it could change how companies maintain old systems, how fast they adopt safer languages, and how the next generation of software gets built. And the emphasis on "idiomatic" Rust is key: the goal is not just code that compiles, but code that is clean, safe, and maintainable in the long term.
To understand why this matters, you need to know what makes Rust special. Languages like C and C++ give programmers direct control over memory. That control is powerful, but it is also dangerous. A single mistake, forgetting to free memory, using it after it has been freed, or letting two parts of a program write to the same data at once, can lead to crashes, data leaks, or security breaches. These are called "memory safety" bugs, and they have been at the root of countless vulnerabilities for decades.
Rust solves this by enforcing strict rules at compile time. The compiler checks that memory is used safely before the program ever runs. If you follow the rules, you get the performance of C and C++ without the same risk. That is why governments, cloud providers, and major tech companies have been pushing for Rust in new projects. The problem is legacy code: millions of lines of C and C++ already exist, and rewriting them by hand is slow, expensive, and error-prone.
That is where RIIR comes in. The idea is simple but ambitious: rather than patch old code forever, rewrite it in Rust. But hand-rewriting a large codebase can take years. AI offers a shortcut, or at least the promise of one.
The extra "I" in RIIIR stands for "idiomatic." It sounds like a small detail, but it is the heart of the matter. Idiomatic code is code that follows the culture and best practices of a language. It uses the features the language was designed around. In Rust, idiomatic code leans on its ownership model, pattern matching, error handling, and safe concurrency features. It avoids fighting the compiler and instead works with it.
Why does that matter? Because a translation that simply converts C syntax into Rust syntax might compile, but it could be hard to maintain, slow, or even unsafe if it uses "unsafe" blocks to bypass Rust's checks. An AI that produces idiomatic Rust would be doing something much harder: understanding the intent of the original code and expressing it in the natural style of the target language. That is the difference between a mechanical translation and a true rewrite.
The presentation title suggests that AI can now be guided to produce that higher-quality output. That would be a major step forward. It means AI is not just a code generator; it is becoming a code modernizer with a sense of craft.
Large language models have already shown they can write, explain, and translate code. But rewriting a large, complex system requires more than pattern matching. It requires understanding architecture, data flow, edge cases, and the trade-offs that make software work in the real world. The RIIIR idea points to a workflow where AI assists human engineers in a structured way.
One likely approach is to break the rewrite into stages. First, AI analyzes the original code and maps out its structure. Then it proposes a Rust design that is idiomatic from the start, rather than a line-by-line translation. Human experts review and refine the design. Next, AI generates code in small, testable chunks. Automated tests and formal checks verify that the new code behaves like the old code. Throughout, the AI is guided by examples of idiomatic Rust and by feedback from the compiler and from human reviewers.
This is not fully automatic. The presentation's title includes "with AI," not "by AI." That is an important distinction. The most realistic near-term future is a partnership: AI handles the heavy lifting of translation and code generation, while humans set the standards, review the output, and make the final calls. That model is already appearing in other areas of software development, and it fits the complexity of a language like Rust.
For companies that run critical systems on old code, the implications are huge. Legacy modernization is often a multi-year, multi-million-dollar effort. If AI can accelerate the rewrite of C and C++ into Rust, it could reduce costs, lower risk, and shorten timelines. That is especially important in industries where safety and security are non-negotiable: finance, healthcare, automotive, aerospace, and critical infrastructure.
But the benefits go beyond cost. Rust's safety features can reduce the number of vulnerabilities in production systems. That means fewer emergency patches, less downtime, and lower insurance and compliance costs. For business leaders, the message is clear: AI-assisted modernization is not just a technical experiment. It is a strategic tool for managing technical debt and improving resilience.
There is also a talent angle. Rust developers are in high demand and short supply. If AI can help existing C and C++ teams produce idiomatic Rust, it eases the transition. Engineers can focus on design and review rather than memorizing every language detail. That makes the shift to safer languages more practical for organizations that cannot hire an entirely new team.
None of this is easy. Rewriting complex software is one of the hardest tasks in engineering, and AI is not a magic wand. There are real risks. AI models can produce code that looks correct but has subtle bugs. They can miss edge cases. They can generate code that is idiomatic in small examples but falls apart at scale. And they can introduce security flaws if not carefully guided.
There is also the problem of trust. Organizations will not hand over their most critical systems to an AI without strong verification. That means heavy investment in testing, formal methods, and human review. The RIIIR approach only works if the output can be checked rigorously. In that sense, AI does not replace engineering discipline, it makes it more important than ever.
Another challenge is tooling. Idiomatic Rust is not just about syntax; it is about architecture. AI tools will need deep integration with compilers, linters, test frameworks, and version control. They will need to understand the specific constraints of each project. That is a big engineering problem in itself.
Step back, and the RIIIR idea fits a larger trend. AI is moving from autocomplete to autonomy in limited domains. It started with small code suggestions. Then it moved to generating whole functions. Now it is being applied to large-scale transformations: migrating frameworks, updating APIs, translating between languages, and modernizing legacy systems. Each step requires more context, more verification, and more human oversight.
If AI can reliably rewrite code into idiomatic Rust, it could do the same for other languages and frameworks. Imagine AI that modernizes old Java into modern Java, or converts monolithic applications into microservices, or updates code to use the latest security standards. The same pattern applies: understand the old system, design a better target, generate code in small pieces, verify heavily, and keep humans in the loop.
That vision has profound implications for the future of AI. It suggests that the most valuable AI systems will not be the ones that write the most code, but the ones that can safely transform existing systems. That is a harder problem, but it is also a much bigger market. Every large organization has legacy code. If AI can make modernization faster and safer, it becomes a core part of the software lifecycle.
For technical leaders, the RIIIR concept offers several practical lessons:
For business leaders, the takeaway is that AI-assisted modernization is worth watching closely. It could change the economics of technical debt and make safer languages accessible to more organizations. But it requires investment in tools, training, and governance. The companies that prepare now will be best positioned to take advantage.
The presentation title RIIIR: Rewrite It In *Idiomatic* Rust (with AI) may look like a niche technical topic, but it points to something much larger. It shows how AI is evolving from a code assistant into a modernization engine. It highlights the importance of quality, not just speed. And it suggests a future where AI helps organizations move to safer, more maintainable software without starting from scratch.
That future is not here yet. The challenges are real, and the risks are significant. But the direction is clear. AI is becoming a tool for transforming complex systems, not just generating snippets. For anyone who cares about the future of software, and the security of the systems we all rely on, this is a trend worth following closely.