Bubble sort on a Turing machine
Bubble sort is pretty simple in most programming languages ... what about on a Turing Machine? I used all three of Claude 4.6, GLM 5, and GPT 5.2 to get a result, so this exercise was not quite trivial, at least at this time. The resulting machine, bubble_sort_unary.yaml, will take this input: 111011011111110101111101111 and give this output: 101101110111101111101111111 I.e., it's sorting the array [3,2,7,1,5,4]. The machine has 31 states and requires 1424 steps before it comes to a halt. It also introduces two extra symbols onto the tape, 'A' and 'B'. (You could argue that 0 is also an…
Bubble sort on a Turing machine launched on February 13, 2026 with 12 votes, #936 of 16,628 launches that month and more than 90% of that year's launches.
In plain words
This project implements bubble sort algorithms on a Turing machine, a theoretical computing model. Two versions are provided: one using unary notation with 31 states and 1424 steps to sort arrays like [3,2,7,1,5,4], and a simpler version using numbered symbols with 25 states and 63 steps. The implementations were developed with assistance from multiple AI language models and demonstrate how a basic sorting algorithm translates to a minimal computational machine.
written from the facts on this page · September 2026
From the sources
A Turing Machine that will perform a bubble sort on the tape input; compatible with turingmachine.io yaml format. Two variants of the Turing Machine are provided. - purplejacket/bubble_sort_on_tm
A Turing Machine that sorts arrays using bubble sort — implemented as a YAML state-transition table compatible with turingmachine.io , plus a Python emulator to run and verify it locally. Both YAML files can be pasted directly into turingmachine.io to watch the sort happen step by step. # Run the decimal bubble sort and see the result make run-decimal # Run the unary bubble sort make run-unary # Run the full test suite (135 tests) make test # See all available targets make help Requirements Python 3.10+ PyYAML ( pip install pyyaml ) No other dependencies. The test suite uses the standard-library unittest module — no pytest required (though it works with pytest too if you have it). . ├──…from github.com
In the maker’s words, at launch
Bubble sort is pretty simple in most programming languages ... what about on a Turing Machine? I used all three of Claude 4.6, GLM 5, and GPT 5.2 to get a result, so this exercise was not quite trivial, at least at this time. The resulting machine, bubble_sort_unary.yaml, will take this input…
Does a similar job
all alternatives →- S5Sorting 50K Array, HTML5 Web Worker Demo2016 · afshinm.github.io · ▲88
Sorting 50K Array with Bubble Sort
I developed a fast general purpose sorting algorithm2022 · github.com · ▲56The world's fastest general purpose sorting algorithm, 60% faster than Quicksort - hackware1993/ChenSort
An Elementary Introduction to the Wolfram Language2015 · wolfram.com · ▲60Stephen Wolfram's new book on the Wolfram Language
Fast(er) Sorting with Sorting Networks2021 · github.com · ▲28Fast SIMD sorting routines for int and float arrays - zvrba/SortingNetworks
QuadSort, Esoteric Fast Sort2023 · github.com · ▲78Quadsort is a branchless stable adaptive mergesort faster than quicksort. - scandum/quadsort

More ai this month
the category →



Paintings by AI models: programs run through a simulation of oil paint.
AI · 20d ago · stillwet.art
PixVerse R2▲381A real-time world model you can explore and change
AI · 29d ago · world.pixverse.video

Source: Show HN post ↗ · launch text quoted in part
Launched alongside, February 2026
the whole month →



Lovon AI Therapy▲801Feel closer and have more fun with your partner every day!
AI · Feb 2026 · lovon.app

Hello my name is Ben Ward for the past 3 years I have been remastering the financial game Wall Street Raider created by Michael Jenkins originally on DOS in 1986. It has been a rough journey but I finally see the light at the end of the tunnel. I just recently redid the website and thought maybe the full story of how this project came to be would interest you all. Thank you for reading.
Work · Feb 2026 · wallstreetraider.com