Mistral Uses AI to Rewrite Legacy Scientific Software
The project shows where coding agents can help modernize old systems and where human engineers are still needed.
Topics
News
- Meta Warns US Midterm Backlash Could Slow Data Center Expansion
- Google to Invest $17 Billion in Wyoming Data Center Despite US Backlash
- Karnataka to Train 5,000 Government School Teachers in AI
- Aina Unveils AI Ring That Predicts Users’ Next Actions
- CERT-In Warns Banks, Fintech Firms of AI-Driven Cyberattacks
- CERT-In Sets Risk-Based Security Audit Standards for AI Systems
Mistral has used AI agents to help migrate 40,000 lines of legacy scientific software from Fortran 77 to C++ for a European energy operator, offering a practical test of how artificial intelligence can modernize complex systems built with older programming tools.
The software was a physics-intensive reservoir simulator and part of a codebase of about 300,000 lines.
The challenge went well beyond translating one programming language into another. Fortran 77 relies on structures such as shared global memory and implicit variable typing that do not map neatly onto modern C++.
Mistral first built a testing system to check whether the new software produced the same numerical results as the original, including at critical intermediate points identified by the client’s reservoir engineers. This was particularly important as the existing simulator had no test suite.
AI agents were also used to organize fragmented documentation. Mistral generated a map of how different parts of the program called one another and deployed more than 100 agents to examine the code, draw information from old PDFs and document individual components.
But the project also showed the limits of autonomous coding.
In its first attempt, Mistral assigned agents to convert individual Fortran routines independently. The resulting C++ worked but largely preserved the architecture of the old program.
“It looked like Fortran retyped in C++ syntax rather than modernized code,” Mistral said.
A second approach divided work among agents responsible for planning, coding, testing and review. Code quality improved, but the agents could still stall when they encountered difficult bugs.
Mistral eventually settled on a human-supervised system. Engineers reviewed the proposed C++ architecture, while coder, tester and reviewer agents handled individual migration tasks. Humans checked the resulting code and intervened when the agents became stuck.
The first phase covered 40,000 of the codebase’s roughly 300,000 lines.
Mistral cautioned that the project had one important advantage: the original Fortran software was self-contained and could still be run, allowing engineers to compare the old and new versions directly.
Systems that depend on external software, lack a working baseline or contain poorly documented scientific logic would be harder to migrate.
The project suggests AI agents can accelerate the laborious work of understanding, documenting and rewriting legacy software. For complex systems, however, reliable testing and human review remain difficult to remove from the process.


