can you count the letter "t" in:
in real life, i’m not a mathematician; i’m a computer scientist. still a math geek, mind you, but what i really do is very much in the realm of applied math, researching how to build systems to help people program.
one of my pathological obsessions is programming languages. since i first got exposed to trs-80 model 1 basic back in middle school, i’ve been absolutely nuts programming languages. last time i counted, i’d learned about 130 different languages; and i’ve picked up more since then. i’ve written programs most of them. like i said, i’m nuts.
anyway, i decided that it would be amusing to inflict my obsession on you, my readers, with a new feature: the friday pathological programming language. you see, there are plenty of *crazy* people out there; and many of them like to invent programming languages. some very small number of them try to design good languages and succeed; a much larger number try to design good languages and fail; and *then* there are the folks who design the languages i’m going to talk about. they’re the ones who set out to design *bizzare* programming languages, and succeed brilliantly. they call them “esoteric” programming languages. i call them evil.
today, the beautiful grand-daddy of the esoteric language family: the one, the only, the truly and deservedly infamous: [brainfuck!][bf], designed by urban müller. (there are a number of different implementations available; just follow the link.)
only 8 commands – including input and output – all written using symbols. and yet turing complete; and not just turing complete, but actually based on a *real* [formal theoretical design][pprimeprime]. and it’s even been implemented [*in hardware*!][bf-hard]
brainfuck is based on something very much like a twisted cross between a [turing machine][turing] and a [minsky machine][minsky]. it’s got the idea of an input tape, like the turing machine. but unlike the turing machine, each cell of the tape stores a number, which can be incremented or decremented, like a minsky machine. and like a minsky, the only control flow is a test for zero.
the 8 instructions:
1. **>**: move the tape head one cell forward.
2. **<**: move the tape head one cell backward.
3. **+**: increment the value on the current tape cell.
4. **-**: decrement the value on the current tape cell.
5. **.**: output the value on the current tape cell as a character.
6. **,**: input a character and write it's numeric value onto the current tape cell.
7. **[**: jump forward to the first instruction after the matching "]" *if* the value on the current tape cell is 0.
8. **]**: jump backward to the matching "[" *unless* the value on the current tape cell is 0.”.
continues in pretty much the same vein, using a couple of tape cells, and running loops to generate the values of the characters. beautiful, eh?
if that didn’t seem impressive enough, [here][bf-fib] is a really gorgeous implementation of a fibonacci sequence generator, [>>+>+<<<-]>>>[<<<+>>>-]<<[<+>-]>[<+>-]<<<- ]
[bf]:
[bf-fib]:
[turing]:
[minsky]:
[bf-hard]:
[pprimeprime]:
user
The given text has 198 "t"s.
assistant