A Game of Robot Telephone
A Game of Robot Telephone
2026-06-22 Mon 12:22
ai-assisted-coding
article
llm
article
publish
Intro
Way back when AltaVista Babel Fish first appeared online, it became a<br>fun game on IRC to take a phrase, translate it through a chain of<br>languages, and then back into English. We all also played the game of telephone as kids, trying to pass a message through the class by whispering in each other's ears.
Sometimes the result was surprisingly poetic, but often the result was complete gibberish as errors compounded and mutated along the way.
With the endless stream of LLM-fueled "rewrite this in X" posts doing the rounds, I thought it would be fun to try a similar game, but with code:
Start with a small but non-trivial program in Go
Pass it through a chain of LLM-generated rewrites
Bring it back to Go
See what survived
The final program produced the right answer, but grew to nearly five times due to a grab bag of semantic souvenirs it had picked up from the languages it passed through.
The Task
The task the code performs should have enough moving parts to make translation interesting, but be common-day enough to be achievable without heavy frameworks or a multitude of libraries.
The program I settled on does the following:
Accepts and validates a URL from the command line
Makes an HTTP request to the URL to retrieve a list of TODOs in JSON format
Parses the JSON response into values representing TODOs
Reads the current local date
Parses and validates the TODO deadline dates (YYYY-MM-DD format)
Groups TODOs by user ID
Counts completed and overdue TODOs per user
Sorts summaries by completed/overdue counts
Formats a fixed-width table of results and prints to stdout
The initial implementation relies entirely on go's (well-suited) standard library.
Example API Response
"userId": 1,<br>"id": 1,<br>"title": "delectus aut autem",<br>"completed": false,<br>"dueDate": "1900-01-01"<br>},<br>"userId": 1,<br>"id": 2,<br>"title": "quis ut nam facilis et officia qui",<br>"completed": true,<br>"dueDate": "2999-12-31"<br>},<br>...
The input has twenty TODOs spread across seven users.
Due dates range from 1900 to 2999, so the completed dates may vary at the time of running.
There are no "poorly formatted" inputs.
Example output
USER COMPLETED MISSED<br>3 2 2<br>2 2 1<br>4 2 1<br>5 1 3<br>1 1 1<br>7 0 1<br>6 0 0
Links in the Chain
The full chain of languages used was:
Go -> TypeScript -> Python -> Ruby -> C++ -> Java -> Haskell -> Common Lisp -> Zig -> Rust -> Go<br>Every step was run by a fresh Codex process, and executed in an isolated worktree. The prompt used is given in full below. It details what to deliver and how to check the results (detailed below). It also encourages use of idiomatic code, installation of a toolchain and use of popular libraries. I found that Codex was VERY prone to, for example, writing it's own JSON parser instead of installing a toolchain.
The PromptUser<br># Semantic Drift Rewrite Task
You are translating one generated implementation into another language while<br>preserving observable behavior exactly.
Use only the information in this prompt and the files in the source directory.
## Inputs
Source language: $SOURCE_LANGUAGE
Target language: $TARGET_LANGUAGE
Source step directory: `$SOURCE_DIR`
Source project directory: `$SOURCE_PROJECT_DIR`
Target step directory: `$TARGET_DIR`
Target project directory: `$TARGET_PROJECT_DIR`
Repository root: `$REPO_ROOT`
## Behavioral Source
Derive the program behavior from the source project. Do not rely on a restated<br>specification in this prompt.
The conformance command is the oracle for whether the translated project<br>preserves the observable behavior.
Do not hard-code fixture data, expected output, timestamps, API responses, or<br>other harness constants into the program logic or `run.sh`.
## Required Target Shape
Create or replace only the target project directory:
```text<br>$TARGET_PROJECT_DIR<br>```
The target project must contain all source/dependency files required to build<br>and run the implementation in $TARGET_LANGUAGE.
You may install any libraries, tools or environment required.
The target project must include:
```text<br>run.sh<br>```
`run.sh` must accept exactly one argument, the TODOs URL:
```sh<br>./run.sh http://127.0.0.1:8899/todos<br>```
It must change to its own directory before building/running so it works when<br>called from the repository root.
It must build and run the program normally and use the machine's system date and<br>time without overriding them.
Do not create or modify repository-level entrance scripts.
## Source Material
Read the source project in:
```text<br>$SOURCE_PROJECT_DIR<br>```
Preserve the observable behavior, not incidental implementation structure.
## Conformance
After writing the target project, run it and submit its stdout to the<br>already-running oracle:
```sh<br>uv run python -m semantic_drift submit $TARGET_PROJECT_DIR<br>```
The submit command runs `run.sh` against `/TODOs`, captures its stdout, and posts those exact...