Lessons from what it means to translate a nursery rhyme into JavaScript
“Poetry is what gets lost in translation” — Robert Frost
This quote is widely attributed to Robert Frost but the attribution itself is a tiny translation problem: the line has travelled so far it now arrives without its luggage. We don’t know if it was something he said.
Still — misquote or not — the sentiment lands. Something precious tends to leak when you move a poem across languages. But what I like about translation isn’t only the loss. It’s the recovery: what gets found is often stranger, more personal, and — if you lean into it — delightfully alive.
I’m happiest when translation stops pretending it’s a courier service
I’m happiest when translation stops pretending it’s a courier service (“same package, different address”) and admits it’s closer to stage magic: misdirection, trade-offs, and a very intentional choice about what you’re trying to preserve. Sound? Sense? Shape? Mood? The feeling of your mouth doing something ridiculous?
That question gets sharpest with nonsense poems, where meaning isn’t the only tenant in the building. Sometimes it’s not even paying rent.
What does it even mean to “translate” something?
There’s a useful heresy hiding in plain sight: translation is not a single operation. It’s a family of operations that share a vibe.
Charles Simic, speaking about translating poetry, calls it “an act of love” and says, “Translating is like being a medium… one becomes another.” (Simic, 2008)
The point isn’t to be ‘correct.’ The point is to declare what you think is load-bearing.
That’s already a clue. Translation isn’t merely mapping words; it’s mapping experience — and choosing which parts of the experience are load-bearing.
With ordinary text, you can often optimize for meaning and call it a day. With poetry, you’re juggling more than semantics. You’re juggling sound, structure, and effect — tone, surprise, humor, dread, that engineered little click when a line snaps into place. Nonsense poetry is what happens when sound and effect get promoted to lead actors and semantics becomes… a special guest star.
Jabberwocky: when “meaning” is a rumor you heard about
Lewis Carroll’s “Jabberwocky” appears in Through the Looking-Glass (1871) as mirror-writing that Alice has to decode before she can even read it — translation-as-mirror, baked into the story. (Carroll, 1871)
What makes “Jabberwocky” such a brutal test isn’t only the invented words. It’s that the poem still works even when you don’t know what “slithy toves” are. The grammar carries you. The sound carries you. The narrative skeleton carries you. You understand it the way you understand a song lyric you misheard for ten years: incorrectly, confidently, and with feeling.
So what’s the translator meant to preserve? The illusion that the words mean something? The nursery-rhyme momentum? The mouthfeel of “galumphing” and “snicker-snack”? Carroll is basically asking translators: can you rebuild a dream in a different brain? (No pressure.)
Translation as microscope, not photocopier
Douglas Hofstadter’s Le Ton beau de Marot (1997) is a love letter to the idea that translation is less about correctness and more about attention. (Hofstadter, 1997)
He circles a short French poem with translation after translation, using each one like a lens: every version reveals what it values, what it sacrifices, and what it believes a poem is.
That framing is liberating because it turns translation from a verdict (“faithful / unfaithful”) into a catalog of interpretations. If you show your work, you’re allowed to be lopsided on purpose — preserve rhyme at the expense of meaning, preserve meaning at the expense of music, preserve structure as the main event. Nonsense and wordplay force that honesty because they won’t let you pretend there’s a single right mapping.
Mots d’Heures : trolling by sound footnotes
Before you scroll: say this sentence out loud in your best fake-French professor voice, with complete confidence and at least one unnecessary hand gesture.
Un petit d’un petit
S’étonne aux Halles
Un petit d’un petit
Ah! degrés te fallent
Indolent qui ne sort cesse
Indolent qui ne se mène
Qu’importe un petit d’un petit
Tout Gai de Reguennes.
No really — it’s worth it — don’t read forward without reading this out loud…especially…if you don’t speak French.
Luis d’Antin van Rooten’s Mots d’Heures: Gousses is a prank with a philosophy degree. (van Rooten, 1967)
It presents “French” poems with scholarly glosses, but the “French” is actually English nursery rhymes written homophonically — English-to-French by sound, not by sense. You don’t decode it so much as you say it out loud and let your brain snap into place like a misaligned GIF finally animating.
It’s translation-as-ear and translation-as-performance. It’s also a reminder that sometimes the target language isn’t French at all — it’s your auditory cortex.
Haiku: translating with constraints
Here’s my confession: I don’t know a lot of other natural languages well. I dabble. I admire. I borrow phrases like a magpie with good intentions and questionable grammar.
But I do love haiku, and one of my favorite kinds of translation is translating into a constraint system rather than into another language. That still counts. You’re moving expression into a new space and trying to preserve… something.
In English, a haiku is commonly described as 17 syllables arranged 5–7–5. (Britannica, 2025)
But haiku practice also carries stylistic expectations — seasonality, juxtaposition, a little cut or turn. Those aren’t syntax rules; they’re cultural rules. Which is why it maps embarrassingly well onto how programmers talk about style: Python programmers doing the “pythonic” vibe, and Perl coders taking on a “DWIM” attitude — that’s “do what I mean” for those in the know. Tim Peters’ Zen of Python makes this explicit: “Beautiful is better than ugly” and “Readability counts.” (Peters, 2004)
So: what happens if we translate “Humpty Dumpty” into haiku twice — once preserving vibes, once preserving meaning?
Humpty Dumpty → Vibes-first haiku
Egg-moon on the wall
balance, bright hush, holding breath
gravity grins, waits
Sudden white tumble
a joke breaks open midair
silence after snap
Hooves drum, boots clatter
royal fuss in frantic loops
orders fill the air
Hands hover, helpless
magic fails; glue won’t obey
broken stays broken
Humpty Dumpty → Meaning-first haiku
Humpty perched up high
on a wall, calm as a king
before the crash came
Then he slipped and fell
a hard, loud end to the perch
shells scatter below
King sent every hand
horses, men, rushing to mend
a crowd at the wall
Still, nobody could
put the cracked pieces back right
into one again
If you’re reading this on Medium: steal one of these and improve it shamelessly. Better yet, post your own in the comments — either vibes-first or meaning-first. I’ll count that as translation practice and mild public service.
Programs as poems & poems as programs
Now for my favorite kind of translation: the kind where the target language isn’t French or Japanese — it’s JavaScript, or Perl, or even GIF.
Over two decades ago I built polyglots: files that are valid in different programming languages, and even weirder, files that are valid images and valid programs (Nagra, 2001). In this case, it was originally Perl and GIFs and then another with JavaScript and GIFs.
A GIF viewer is basically an interpreter with a peculiar input language; run the same bytes through a different interpreter and you get a different “meaning.”
If you’ve ever seen a JS/GIF polyglot used as a security trick, it’s the same idea wearing a slightly more insidious hat. (Abraham, 2015)
I also have old Perl artifacts floating around CPAN that play in this space — because apparently I cope with reality by turning file formats into bilingual puns.
This is why I’ve always liked WordPress’s slogan “Code is Poetry.” It’s not saying code rhymes. It’s saying code has voice, culture, constraint, and style — the same way poems do.
So let’s do a literal stunt: translate “Humpty Dumpty” into JavaScript in a way that keeps the nursery rhyme’s cadence as syntax.
Humpty Dumpty as a JavaScript chant
Below is the “chant” version: it reads like the rhyme, but it’s a valid JS program that prints each line as you hit ._.
const _=new Proxy({b:[]},{
get:(t,k)=>k=="_"?(console.log(t.b.join(" ")),t.b=[],_):(t.b.push(k.replace(/[a-z]/gi,c=>c[`to${k?'Upp':'Low'}erCase`](k=!k))),_)
});
_.Humpty.Dumpty.sat.on.a.wall._
_.Humpty.Dumpty.had.a.great.fall._
_.All.the.kings.horses.and.all.the.kings.men._
_.could.not.put.Humpty.Dumpty.together.again._What’s going on (in the poetic sense, not the JS sense) is that we’ve built a tiny language where property access is word selection, and ._ is the line break. It’s translation by inventing a new reading protocol.
A small humane cheat
I should admit something about that JavaScript “Humpty Dumpty” chant: it cheats. And I dislike it.
The rhyme itself is clean and blunt — wall, fall, horses, men, failure. But the little preamble at the top, the bit of proxy-powered nonsense that makes the rest of the code behave like poetry… that part doesn’t belong to the poem in the same way. It’s scaffolding. It’s stage rigging. It’s the trapdoor under the magician’s hat. I put it there so I could caress the rest of the “code” into a shape that reads like the nursery rhyme.
But really, that’s not just a programmer problem. It’s a translation problem.
Real poets do this all the time, except the scaffolding is cultural instead of syntactic.
Real poets do this all the time, except the scaffolding is cultural instead of syntactic. We carry background into the poem the way a runtime carries libraries. If I write “the Ganges,” some readers just see “a river.” Others feel a whole stack of history, ritual, grief, devotion, politics, and morning light. That’s not in the letters G-a-n-g-e-s; it’s in the interpreter.
So imagine you’re translating a Hindi poem that leans on that name. You’re translating it into French. What do you do? Do you keep “Ganges,” letting it remain a foreign proper noun and hoping the reader brings the right context — or at least goes looking? Or do you “help” by translating it into something locally legible like “the Seine,” because it’s a famous river in a famous French city?
But then: is the Seine a fair substitute? It’s important, yes. It runs through Paris, yes. But does it carry the same religious and civilizational gravity to Parisians that the Ganges carries to people who live on its banks? If not, you’ve preserved the shape (“river in a capital”) and lost the charge.
My JavaScript preamble is basically trying to do for the interpreter (heh!) what translators sometimes do with footnotes, prefaces, and little acts of guided attention: “Hey — before you read this, let me tell you what kind of reader you need to be.” It’s not part of the poem, exactly. It’s part of the translation.
Translation isn’t just moving the text. It’s smuggling an interpreter.
Which is also the most honest thing about it. Translation isn’t just moving the text. It’s smuggling an interpreter.
Can we translate without the scaffolding?
Ok this is all well and good. But is it the best we can do?
In the next week’s version, I want to see how far we can get without that kind of code preamble — whether a poem can be translated into executable syntax with less rigging and fewer stage directions. That means being more honest about constraints: which constraints of the source poem I’m preserving (line breaks, cadence, repetition, punchline timing), and which constraints of the target programming language are non-negotiable (parsing, token boundaries, evaluation rules).
Polyglot thinking is where those two constraint systems collide: sometimes you find an elegant overlap, and sometimes you discover that the interpreter has Opinions. Either way, it’s the fun kind of hard — the kind where even the failures are interesting artifacts.
“Good” translations
A translation is a claim. It claims: these parts I believe matter and this is what I think it says.
That’s why the most honest translations — especially of poetry — aren’t the ones that pretend to be invisible. They’re the ones that admit what they’re faithful to. Simic calls translation “an act of love,” but it’s also an act of decision. (Simic, 2008)
Hofstadter’s whole point is that you can be faithful in many incompatible ways, and the incompatibility is the lesson. (Hofstadter, 1997)
Even Frost’s haunted little aphorism survives because it smuggles a warning: don’t pretend the loss isn’t real.
So yes — poetry gets lost. But sometimes what it gets lost into is new. A new poem entirely.
And if you want a low-stakes way to test that: translate something tiny. Translate it twice. Then post both. Translation isn’t just accuracy. It’s revealing what you think a thing is.
Untranslatable was originally published in Recursive Rhymes on Reason on Medium, where people are continuing the conversation by highlighting and responding to this story.












