4RL
Brainfuck spelled with the letters of "for real", and one more command to stop.
Frogstair, 2020 · Turing complete: with unbounded memory · ●○○ easy · esolangs.org
Tested with 4 known programs · Test method
Run it
The idea
Frogstair made 4RL in April 2020, as a breed of brainfuck. The name is said "for real", and its characters 4, r, e, a, l and their capitals are the whole language. Eight of the nine commands are brainfuck's, one for one. The ninth, A, ends the program on the spot, which brainfuck can only do by running off the end of its code.
The machine
| Command | Brainfuck | Does |
|---|---|---|
4 | + | Add 1 to the cell |
r | - | Take 1 from the cell |
e | > | Move right |
a | < | Move left |
l | [ | Jump past the matching L if the cell is 0 |
L | ] | Jump back to the matching l if the cell is not 0 |
R | , | Read a character into the cell |
E | . | Print the cell as a character |
A | End the program |
The tape has 65,536 cells of one byte each. Case matters, so e moves and E prints. Every other character is skipped.
Example
The Hello World is the well known brainfuck one, letter for letter.
The Hello World is the well known brainfuck one, letter for letter.
The cat reads and prints until it reads a 0. The end of the input reads as 0 too.
The truth machine prints what it reads, then takes 2 from it each round. The 48 of 0 runs out after 24 rounds. The 49 of 1 never does, and after 256 rounds a counter beside it wraps to 0 and sends the loop into one that prints 1 forever.
Sixty-six 4 make the 66 of B. The first E prints it and A stops the second.
Patterns it teaches
- Turing tarpit: brainfuck's eight commands under other names.
Further
See also
4RL builds on Brainfuck.
Brainfuck derivatives
Write your own in Run Convert a program from 4RL
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: 4rl.
Command line
shib run 4rl -e 'RlERL' --input 'cat dog'