Yaren
Brainfuck on bits, where the arrows turn the program around instead of moving the pointer.
PythonshellDebugwindow, 2020 · Turing complete: unknown · ●●○ moderate · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
PythonshellDebugwindow made Yaren in 2020 to bring Befunge's < and > to brainfuck. The language is named after the de facto capital of Nauru. There is no jump back. ] does nothing, so a loop has to turn the program counter around with < and run part of the program backwards. Moving left, [ and ] swap roles.
Read the story
The tape holds single bits. + toggles a bit and steps right in one go, and - steps left, so stepping right without changing a bit takes +-+.
The machine
| Command | Does |
|---|---|
+ | Toggle the current bit, then move the pointer right |
- | Move the pointer left |
[ | If the bit is 0, jump to the matching ] |
] | Nothing; it marks where [ jumps to |
< > | Make the program counter move left or right |
, . | Read or write a byte over the current cell and the seven to its right |
The current cell is the lowest bit of a byte. The run ends when the program counter leaves the program at either end. At the end of input , reads 0.
Example
For each letter the Hello World walks eight cells left into fresh ones, toggles the bits it needs on the…
For each letter the Hello World walks eight cells left into fresh ones, toggles the bits it needs on the way and prints. It prints a line feed at the end.
The truth machine. On 0 the [ jumps past the loop and the last . prints the 0. On 1 it bounces between > and < and prints 1 on every pass over the . between them.
Patterns it teaches
- Turing tarpit: brainfuck's loop rebuilt from a direction change.
Further
See also
Yaren builds on Brainfuck.
Brainfuck derivatives
Cell-based
Write your own in Run Convert a program from Yaren
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: yaren.
Command line
shib run yaren -e ',[>.<].' --input '0'shib manual yarenSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/yaren.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org