Tuesday, December 19, 2006

Possibly the smallest Turing-complete programming language in the world

8 instructions, that's all you need to have a Turing-complete imperative interpreted language:
brainfuck is the name!

You can play with an interpreter of BF (in javascript)... try this program:

code: ,+.
input: a
the output should be: b

This one instead, should be a quine:
code: >,[.>,]<[<]>[.>]
input:
>,[.>,]<[<]>[.>]

;)

Even the above mentioned interpreter is incredibly small...

Another curious program related to BF is Nanopond, that is described like this by its author:
"The world's smallest and simplest evolvable instruction set virtual machine.
...
It is similar in design to Tierra and Avida but considerably smaller and simpler."
Terrific, ah!? Worth a look :D

No comments:

Post a Comment