# 陶哲轩用 AI 编码代理将 1999 年 Java 教学 Applet 移植到 JavaScript

- 来源：Hacker News 热门（buzzing.cc 中文翻译）
- 作者：subset
- 发布时间：2026-07-12 21:35
- AIHOT 分数：58
- AIHOT 链接：https://aihot.virxact.com/items/cmrhutsrg00p6biidn7hslbv2
- 原文链接：https://terrytao.wordpress.com/2026/07/11/old-and-new-apps-via-modern-coding-agents

## AI 摘要

数学家陶哲轩近日尝试用现代 AI 编码代理，将自己在 1999 年用 Java 1.0 编写的二十多个教学 Applet 移植到 JavaScript。移植过程仅耗时数小时，所有旧 Applet 恢复运行，部分还获得了图形升级（如 Besicovitch 集 Applet 从单色变为彩色）。陶哲轩称仅发现一个拖拽事件小 bug，而 AI 反而识别出原始代码中两个未知 bug。受此启发，他进一步用“vibe coding”方式在数小时内实现了 1999 年未完成的狭义相对论可视化工具，并为当天发表的 Gilbreath 猜想论文生成了配套交互式可视化工具。

## 正文

I have been interested in machine-assisted ways to do and teach mathematics from as far back as 1999, when I started coding several applets in Java 1.0, both for my complex analysis and linear algebra courses, to visualize various mathematical objects I was interested in (such as honeycombs or Besicovitch sets). This was moderately successful; but the applets were time-consuming to program, and eventually the standards for web pages stopped supporting this version of Java, and the applets became non-functional.

However, in the last few days I have begun the process of migrating much of my old web page and blog data to a more maintainable repository, using modern AI assistance. As an experiment, I asked the agent to port my old applets to a modern supported language (we landed on Javascript), and it managed to do so in a matter of hours, with all of my old applets now functional again, with even a few graphical upgrades (for instance, the Besicovitch set applet is now colorized, in contrast to my original monochrome version). I am particularly pleased to see the honeycomb applet that I wrote with Allen Knutson in 1999 come back to life, as this was a particularly tricky one to code by hand:

Notoriously, LLM-based coding agents can create various blatant or subtle bugs in their code; but in the porting of these two dozen or so applets, I could only find one minor bug (the handling of a drag event in one of the complex analysis applets had unwanted behavior when dragging outside of the main box), and in fact the agent identified two bugs in the original code that I was not aware of, so it ended up being a net wash as far as code quality was concerned. In any event, as these applets are meant to be secondary visual aids rather than critical components of a mathematical argument, the downside risk of such bugs is relatively low.

The process was painless enough that I decided to also try coding some new apps, in addition to porting the old ones. Back in 1999 I had an ambitious idea for a visualization tool for special relativity; this was before the release of the software tool Inkscape, but the idea I had in mind was basically “Inkscape, but in Minkowski space”. I had even started writing Java code for this app, but the code complexity became too much for me, and I abandoned the project. However, after a couple hours of “vibe coding” with an AI agent, I was finally able to generate an applet that matched the vision I had back in 1999, which can now be found here. A summary of the conversation I had with the agent to generate this code can be found here (it has been edited down to remove a large number of tedious technical implementation reports). While I have playtested the app somewhat, I would be interested in receiving further feedback on this “alpha” version of the applet, as I am sure (especially given the LLM-generated nature of the code) that there are still some bugs and rough edges to be ironed out.

After writing my blog post on the Gilbreath conjecture paper earlier today, I realized that I could similarly ask the agent to code a visualization tool for the Gilbreath conjecture to accompany the paper and blog post. After another few hours of conversation, this is now done; you can try out the visualization here. Again, the procedure was quite painless (see this transcript of the process), and I think I may add such interactive visualizations as supplements for future papers; as such supplements are not mission-critical to the core of the paper, I again feel that the downside risk of using guided interaction with LLM agents to generate such visualizations is acceptable.
