Zero divergences across 321,331 data points. That's the result when developer Daniel Janus pointed Claude Opus 4.6 at two non-trivial codebases and asked it to translate them into entirely different programming languages.
The project wasn't a toy demo. Janus translated Morfeusz, a C++ morphological analyzer for the Polish language, into pure Java. Then he translated Concraft-pl, a Haskell morphosyntactic tagger (software that figures out parts of speech in context), into Clojure. Both involved complex algorithms, binary file formats, and language-specific quirks that would trip up a naive automated approach.
The Results Hold Up Under Pressure
To validate the C++ to Java translation, Janus ran both the original and the new version against the entire Polish novel Quo Vadis - 4,364 paragraphs. The output matched perfectly: all 321,331 morphological interpretations were identical between the two implementations. The whole effort took about 3 hours of developer time and roughly $50 in API costs.
The Haskell to Clojure translation went even smoother. The final output was byte-identical to the original Haskell binary on test inputs, and Janus said it required less supervision than the first project.
How He Actually Did It
Janus used Claude Opus 4.6 with its full 1 million token context window (enough to hold roughly 2,500 pages of text at once). But the interesting part isn't the model - it's the method:
- Iterative testing over batch generation. He started with simple inputs, moved to full paragraphs, then validated against an entire novel. Each stage caught issues the previous one missed.
- Real output comparison. Rather than eyeballing the translated code or writing unit tests, he compared actual outputs from both implementations. This is a much higher bar than "does it compile and look right."
- Structured project management. He used an
AGENTS.mdfile and aplansdirectory to track progress, giving Claude context about what had been done and what came next. - Active supervision. He nudged Claude when it went off track - for example, telling it to compile the code itself rather than just generating it and hoping for the best.
The codebases involved real complexity: Viterbi disambiguation algorithms (used in speech recognition and NLP to find the most likely sequence of hidden states), finite state automaton traversal, conditional random fields, and custom binary serialization formats. This wasn't "translate a REST API from Python to JavaScript."
A Case for Translation as Learning
Janus makes a point that goes beyond productivity metrics. He argues the translated code gave him something the originals didn't: understanding. With the Clojure versions, he could explore algorithms interactively in a REPL, visualize data structures, and ask Claude to write documentation explaining how each piece worked.
This reframes code translation from "I need this in a different language" to "I want to understand what this code actually does, and translating it is the fastest path there."
For anyone sitting on legacy codebases in languages their team no longer works in, this is a practical template. The $50 and 3 hours for a validated, production-comparable translation of a C++ library is a real data point - not a benchmark on a contrived problem, but a working tool tested against a full novel's worth of real-world data.