Spoon

Dialect of programming language Brainfuck

Spoon is a dialect of Brainfuck, in which one-character commands are replaced with binary sequences of 0s and 1s. Spoon was created in 1998 by Steven Goodwin as a language which actually used only two tokens.

Binary codes for commands used were chosen using Huffman encoding, with probabilities of each command calculated from a set of example programs. The resulting conversion table follows:

  • + -> 1
  • - -> 000
  • > -> 010
  • < -> 011
  • [ -> 00100
  • ] -> 0011
  • . -> 001010
  • , -> 0010110

Spoon has also two extra commands — 00101110 to output the content of memory (used for debug purposes only) and 00101111 to stop program execution. The complete set of 10 commands forms a prefix-free code, so the program written in Spoon doesn’t require extra delimiters between commands and can be read uniquely.

Examples:

Hello, World!:

Example for versions EsCo 0.511 (Brainfuck)

This example is Spoon translation of second Brainfuck example. Note that the intended way of coding in Spoon allows writing commands without delimiters, but current version of EsCo requires that commands are space-separated.

1111110010001011111111111101100000110100010100101111111111001000101111111111011000001101
0100101011111110010100010101110010100101111001000101111111111101100000110100010100111110
0100010000000000000011000001101000101001101101101101111100100010111110110000011010001010
0100100010101110010100000000000000000000010100000000000000000000000000010100100101001010