Show HN: Bubble sort on a Turing machine

Dev sorts numbers with a tape‑and‑pencil computer — commenters cheer, groan, and meme

TLDR: A developer built bubble sort on a tape-style “theoretical computer” and shared it with a step-by-step viewer, plus a tougher unary version. Comments exploded into art-vs-uselessness debates, algorithm snobbery, and YAML jokes, proving educational stunts still ignite big feelings — and plenty of memes.

A coder just showed off a bubble sort running on a Turing machine — think “super basic, tape‑based computer” — and the internet immediately split into two noisy camps. The wow crowd called it nerd art and loved watching numbers shuffle step‑by‑step on turingmachine.io. The why crowd asked, loudly, why anyone would do this with bubble sort, the slowpoke of sorting. Cue drama: one side argues it’s a perfect teaching demo, the other demands “do quicksort next or it doesn’t count.”

The post includes two versions: a simple digit one and a hard‑mode unary version (numbers made of 1s with 0s as dividers). That “unary workout” sparked memes like “CrossFit for computers” and “leg day for the tape head.” People cackled at the test suite (“no pytest?”) and the YAML setup (“YAML considered harmful, yet somehow sorting”). When they learned it sorts 327154 into 123457 in 63 steps, jokes flew: “My coffee machine is faster.”

Algorithm purists nitpicked bubble sort’s reputation, while educators defended it as stable, visual, and clear. Pedants debated digits limited to 1–7, and a cameo test file for the legendary Busy Beaver fueled “next up: BB in YAML” taunts. Verdict from the comments: pointless brilliance meets delightful chaos — and everyone pressed play anyway.

Key Points

  • Two Turing machine bubble sort programs are provided as YAML: a decimal-digit version and a unary 0-delimited version.
  • A Python 3.10+ emulator with PyYAML dependency runs the machines locally; both YAMLs work on turingmachine.io.
  • The decimal version uses 25 states in grouped roles and sorts 327154 to 123457 in 63 steps.
  • The unary version uses marking-based comparison and swapping across a 0 delimiter, with 31 states in six groups.
  • The project includes make targets, a 135-test suite using unittest, fixtures, and detailed documentation.

Hottest takes

“Because we can is the only acceptable answer” — bitflip_bandit
“Bubble sort on a Turing machine? Peak beautiful uselessness” — algoSnob
“Unary mode is CrossFit for CPUs — no pain, no gain” — yamlYikes
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.