AI Migrates 250,000 Lines of Legacy Code: The Fear of ‘It Will All End If That Person Leaves’ Is Coming to an End
Related Articles
“It Will All End If That Person Leaves” — Are You Still Carrying That Fear?
In local small and medium-sized enterprises, I have lost count of how many times I have heard this kind of talk.
“Our system can only be handled by Mr. Tanaka.”
“That code is unreadable by anyone, but it works, so we leave it alone.”
“I don’t even want to think about what will happen when Mr. Tanaka retires…”
Legacy code. Fortran written 20 years ago, Perl from 10 years ago, and VBA written by someone unknown. It runs. Therefore, it is left untouched. There is no one who can touch it. But if it stops, the business stops.
AI is beginning to defuse this “dependency bomb.” Moreover, it is doing so at an unprecedented speed.
This article highlights three cases: the AI migration of 250,000 lines of weather simulation code, AI translation to Rust in the field of bioinformatics, and the complete automation of CFD (Computational Fluid Dynamics) workflows. Each of these tasks, which would have been impossible without a “craftsman with 20 years of experience in the field,” is now being initiated by AI.
AI Migrated 250,000 Lines of Fortran Code in Just Weeks
In the world of weather simulation, Fortran code written decades ago is still in active use. The codebase consists of 250,000 lines. Migrating this to a new environment would traditionally require a team of skilled engineers to work for over six months. Outsourcing could cost several million yen. Even if attempted in-house, it would be nearly impossible to hire engineers who can read Fortran.
However, recent research shows that AI completed this migration in just a few weeks. The AI analyzes the structure of the code, understands the dependencies, and generates code that fits the new environment. Human involvement is limited to review and final confirmation.
What’s crucial here is the change in cost dynamics. If this migration were outsourced, assuming an engineer’s monthly rate of 1 million yen for a team of five over six months, it would amount to 30 million yen. By using AI, even when factoring in tool usage fees and review labor, the cost could potentially be reduced to several hundred thousand yen. That’s a difference of an entire order of magnitude.
Of course, not many small and medium-sized enterprises have 250,000 lines of weather code. But the structure is the same. Thousands to tens of thousands of lines of legacy code underpin business operations, with only one person in-house able to touch it. If that person leaves, the only option is to outsource. Outsourcing partners also tend to shy away from legacy languages, and even if estimates come in, they are often prohibitively expensive.
AI-driven code migration fundamentally changes this “checkmate” structure.
Software Size Reduced to One-Eighth, Build Time Cut to One-Tenth — Automatic Translation to Rust
Another shocking case in the field of bioinformatics involves AI automatically translating legacy tools written in old languages into Rust using static analysis.
The results are as follows:
- Software Size: Reduced to about one-eighth
- Build Time: Shortened to about one-tenth
The numbers alone are extraordinary. A reduction to one-eighth means that software weighing 1.6GB shrinks to 20MB.
Why does this happen? Old code often contains redundant processes dependent on past environments, unused libraries, and historical detours. When humans attempt to tidy this up, it becomes a battle against the fear of not knowing “what will break if I delete this.” AI, through static analysis, understands the entire code’s dependencies and reconstructs only the necessary logic in Rust. What humans found daunting—”rewriting everything”—is handled effortlessly by AI.
The benefits of converting to Rust extend beyond speed. Memory safety is guaranteed at the language level, significantly reducing security risks. Vulnerabilities like buffer overflows lurking in old C code can be structurally eliminated simply by changing the language.
For small and medium-sized enterprises, the implication is clear: the option to “discard old code and rebuild anew” has become feasible at a realistic cost thanks to AI. What previously stalled at “I want to rebuild, but I don’t have the budget” is now gaining momentum.
Simulations Run Even Without CFD Experts
The third case involves the automation of CFD (Computational Fluid Dynamics). A framework called Foam-Agent has emerged, allowing the entire CFD workflow to be automated using only natural language prompts.
CFD is a technology that simulates fluid behavior using computers. It is widely used in manufacturing for optimizing product design, HVAC design, and analyzing flow rates in piping. The issue is that mastering CFD requires specialized knowledge, leading to extremely high learning costs. Open-source tools like OpenFOAM are free to use, but setting up configuration files, generating meshes, setting boundary conditions, and selecting solvers cannot be done correctly without expertise.
Foam-Agent automates this entire process by simply receiving instructions in natural language. For example, if you input, “Calculate the drag force when a 50mm diameter cylinder is subjected to airflow at 10m/s,” the AI generates the necessary configuration files, organizes dependencies, and executes the simulation. If errors occur, it attempts automatic corrections.
What does this mean?
Traditionally, outsourcing a CFD simulation would cost between 500,000 to 2 million yen per instance. Attempting it in-house would require a CFD engineer with an annual salary ranging from 6 million to 10 million yen. Both amounts are difficult for small manufacturing companies to manage.
Now, it can be done with just the cost of AI tool usage and the labor of in-house design personnel. With monthly AI tool fees of just a few tens of thousands of yen, it is possible to complete several hundred thousand yen worth of simulations in-house.
For local manufacturers, this means “gaining access to the same tools as large corporations.” The simulation capabilities that only financially strong large companies could afford are now within reach for small and medium-sized enterprises at a cost of just a few tens of thousands of yen per month. This reversal of structure is significant.
The Essence Is Not “Code Migration” but “Dismantling Dependency”
Having examined these three cases, the common thread is that “systems can now operate without experts.”
- Code can be migrated even without a craftsman who can read Fortran.
- Legacy code can be rewritten in modern languages even without someone who understands the overall structure.
- Simulations can be executed even without CFD experts.
This is not about “needing fewer people.” It’s about “not having to depend on a specific individual.”
In small and medium-sized enterprises, dependency has been accepted as an unavoidable reality. With fewer people, there’s no room for creating handover documents. Thus, they continue to operate while bearing the risk of “it will all end if that person leaves.”
AI breaks this structure. Knowledge that was previously confined to the mind of a specific individual is transformed into a form that AI can replicate. Both code migration and simulation execution shift from “someone who knows how to do it” to “AI that can be instructed on how to do it.”
So, What Should We Do?
For those who think, “We don’t have any legacy code,” is that really true?
Excel macros, Access databases, Python scripts created by someone long ago, custom WordPress plugins — broadly defined legacy code exists in almost every small and medium-sized enterprise.
Here are three things to start with:
1. Conduct an inventory. Identify “codes and systems that only specific individuals can handle” within the organization. Just listing them is sufficient.
2. Quantify the risk. If that person leaves, how much would it cost to recover through outsourcing? Even just obtaining estimates can visualize the magnitude of the risk.
3. Start small. There’s no need to immediately migrate 250,000 lines of code. Start by having a few hundred lines of scripts read by Claude or GPT-4 and translated into another language. Test whether it works. This will give you a feel for “how much can be entrusted to AI.”
The important thing is not to aim for perfection. AI outputs are not 100% accurate. However, they are overwhelmingly faster and cheaper than starting from scratch with humans. If something comes out with 80% accuracy, humans can correct the remaining 20%. This is far more realistic than searching for a craftsman engineer for six months.
When weighing the risk of leaving “it will all end if that person leaves” against the cost of systematizing with AI, the answer is likely already clear.
JA
EN