Terence Tao spent a few hours with an AI coding agent last week and cleared 27 years of deferred maintenance. He gave it 24 Java 1.0 math visualization applets from 1999 — the kind that stopped running when browsers dropped Java support — and asked it to port them to JavaScript. It did. Then it found two bugs in his original code he’d never noticed.
Tao is a Fields Medal winner. The bugs had been sitting in his code for nearly three decades.
What Actually Happened
Tao wrote his first interactive math applets in Java 1.0 in 1999 for his complex analysis and linear algebra courses. They visualized honeycombs, Besicovitch sets, and other mathematical objects. When browser support for Java evaporated, the applets went dark. He never had time to port them.
Last month, he asked a modern AI coding agent to do it. The agent worked through all 24 applets in hours, translating Java AWT drawing calls to Canvas API equivalents and rewriting the Java mouse listener model to JavaScript’s DOM event system. The Besicovitch set applet got a bonus upgrade: colorization the original never had.
Tao found one minor bug in the ported code — a drag event handling issue. The agent found two bugs in his original Java. Net result: better code than he started with. His own summary: “it ended up being a net wash.”
The Bug Finding Is the Actual Story
The speed is impressive. The bug discovery is more interesting.
Finding defects in 27-year-old code that the original author missed is not something most people would put on an AI agent’s resume. But that’s what happened here. The porting process forced the agent to deeply parse the original logic, and in doing so, it surfaced errors that had existed undetected since the Clinton administration.
This has direct implications for teams sitting on legacy codebases. Bug detection in old code is expensive — it requires developers to build enough context to know what the code was supposed to do, then find where it doesn’t. AI agents, when given sufficient context, can surface these issues as a side effect of doing something else entirely.
Beyond Porting: New Tools in Hours
Tao didn’t stop at migration. He also used the agent to build two entirely new tools he’d been meaning to create since 1999. A spacetime diagram visualizer — “Inkscape, but in Minkowski space” — was an abandoned project from his first year of coding that an AI agent completed in “a couple hours of vibe coding.” He also built an interactive Gilbreath’s conjecture visualization and has a random variable visualizer in progress.
Tao published the annotated conversation transcripts for both new projects — treating AI conversations as auditable records. That’s a practice more engineering teams should adopt.
His Risk Framework Is Worth Stealing
Tao wasn’t cavalier about this. He made a deliberate call that these applets are “secondary visual aids rather than critical components of a mathematical argument,” and therefore the “downside risk of such bugs is relatively low.” He applied a different standard to educational tools than he would to research output.
That’s the right mental model — and one most engineering teams haven’t formalized. Not “AI everywhere” and not “AI nowhere.” Risk-tiered deployment: start with the non-critical systems, prove the workflow, build confidence.
He also pushed back on the notion that programming knowledge is now obsolete. His framing: “The high level code design decisions still remain in the ‘vibe coding’ model; it is the lower level syntax and implementation issues that have been largely automated away.” You still need people who understand what the code should do. What’s changed is how much of the writing you have to do yourself.
Your Legacy Code Is Next
Seventy percent of Fortune 500 companies still run software over two decades old. The average enterprise burns 40% of its IT budget just maintaining legacy systems. Developers spend roughly a third of their time on technical debt instead of new features.
The Tao experiment isn’t a curiosity — it’s a field report from someone credible enough to cut through the AI hype. If a coding agent can port 27-year-old Java 1.0 visualization code in hours and improve it in the process, the 10-year-old Python 2 microservice in your stack is a weekend project. The COBOL system nobody wants to touch is a migration candidate, not a permanent fixture.
Morgan Stanley used AI to review 9 million lines of legacy code, saving an estimated 280,000 developer hours. Leidos completed an Oracle-to-PostgreSQL migration 80–90% in minutes with AI assistance. The pattern scales well beyond math visualizations.
The Hacker News discussion captures the developer community’s reaction: most of the 800+ comments aren’t about whether AI agents work for legacy migration. They’re about which systems to target first. That’s the right question. The answer starts with whatever’s been sitting broken in your repo since the last decade.













