The Rosetta Stone — One Function, Twenty Paradigms
Translate a single function into 20 programming paradigms — pure FP, APL, COBOL, regex-only, Excel formulas, SQL, bash. Then rank which paradigm makes the function's intent clearest.
Why this exists
The language you wrote a function in is mostly historical accident — whatever your team picked, whatever the framework demanded, whatever Stack Overflow had answers for. The paradigm is incidental. The intent is not. Reading the same function through twenty other lenses separates what it actually computes from what it was performing for the compiler. The accidental complexity falls away. The essential shape stays.
What you get back
- Twenty translations of the function — one per paradigm, each idiomatic to its own tradition rather than a transliteration of the original.
- A ranking of all twenty by intent clarity, with justification for each position.
- The winning paradigm — the one in which the function reads as a single declarative statement of purpose — and the argument for why it won.
- An explanation of what that paradigm choice tells you about the function's true nature: is this really an array transform? a state machine? a constraint solver? a pipeline? The winner exposes the answer.
When to reach for this pattern
Use it when a function feels overcomplicated and you cannot tell whether the complexity is essential or self-inflicted. Use it when teaching paradigm trade-offs and you want students to feel — not just hear — that abstractions are opinionated. Use it as pre-refactor archaeology when the original author is gone, the comments are wrong, and you need to recover intent from code that has drifted from its purpose for a decade.
Take this single function and translate it into twenty paradigms:
pure functional, OOP, Prolog, APL, COBOL, x86 assembly, regex-only,
SQL-only, bash, Excel formulas, dataflow, Forth, Lisp, Smalltalk
message-passing, tacit/point-free, Verilog, hand-drawn flowchart,
English prose, mathematical notation, and a Petri net. Then rank
them — which paradigm makes the function's actual intent clearest?
Paste this into Claude, Cursor, or Copilot. Change one thing that matters to you.
What I learned shipping it
- Paradigms are not interchangeable. Each one encodes a different theory of what is important — state, time, data shape, control, identity. The translation makes the theory visible.
- The language a function feels most natural in is a clue about what it really does. If your imperative loop collapses into one APL glyph, the function was always about array shape, not iteration.
- Refactoring across paradigms is the cheapest way to find a function's true center of gravity. You do not need to ship the rewrite. You need to see which lens stops fighting the code.