Noodle Soup
Brainfuck written in bits with no separators, where a jump can land in the middle of what used to be another command.
2013 · Turing complete: unknown · ●●● hard · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
Noodle Soup is from 2013 and comes from Spoon, which writes brainfuck as bits. It gives every command new bits and changes the loops. A jump names four bits, and the interpreter searches the source for those four bits followed by a fixed marker. Nothing says where a command starts, so after a jump the same bits can read as a different list of commands. The specification calls each such reading a noodle, and writing a program means fitting several noodles into one string.
The machine
| Bits | Does |
|---|---|
10 01 | Add 1 to the cell, take 1 away |
111 000 | Move right, move left |
1100 | Read a character into the cell |
0011 | Print the cell |
1101xxxx | Back to the last xxxx1011 if the cell is not 0, else on to the next |
0010xxxx | Back to the last xxxx0100 if the cell is 0, else on to the next |
Every character but 0 and 1 is a comment. The run goes on after the destination, and it ends when fewer bits are left than a command needs, or when a jump finds nothing. Cells are bytes that wrap.
Example
Read a character and print it.
Read a character and print it. The space is a comment.
The Hello World is 808 bits that read straight through, 193 times 10, 183 times 01 and 14 times 0011, all on one cell. It prints Hello, World! and a line feed.
The Print 1 2 3 4 5 adds 5 to the first cell and jumps forward to 11110100 near the end. There 11011000 jumps back to 10001011, which starts two bits before the first jump and runs into it. Read from there the bits are >+.<- and the same jump, so the loop runs until the first cell is 0 and the search forward finds nothing. Its output is the bytes 1 to 5. Put 48 in the second cell first and they are digits.
Patterns it teaches
- Encoding tricks: a prefix code with no separators, read again from wherever a jump lands.
- Turing tarpit: brainfuck's commands under a new spelling, with loops that search for their target.
Further
- esolangs.org/wiki/Noodle_Soup
- Spoon, the bit spelling of brainfuck it changes.
See also
Noodle Soup builds on Brainfuck.
Brainfuck derivatives
Cell-based
Write your own in Run Convert a program from Noodle Soup
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: noodle-soup.
Command line
shib run noodle-soup -e '101010101000101111110001100001110110001111010011011000'shib manual noodle-soupSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/noodle-soup.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org