Babylang
Brainfuck in baby talk. Nine words, most of them variants of gugu and gaga.
dodococo · Turing complete: yes · ●○○ easy · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
dodococo made Babylang as a funny variant of COW, after two words the baby says in the movie Babyboss. It is brainfuck with each command swapped for a word, so it belongs to the family the wiki calls TrivialBrainfuckSubstitution. A ninth word, unga, sets a cell to 0.
Read the story
The specification carries an interpreter of 12 lines in Ruby. It turns each word into a piece of Ruby and runs the lot with eval, and this implementation follows it in the details. Cells hold whole numbers without a bound, and a loop test first cuts its cell to a byte. Reading at the end of the input leaves the cell as it was.
The machine
| Word | Brainfuck | Does |
|---|---|---|
gaga gugu | > < | Move right or left |
aaag uuug | + - | Add or take 1 |
unga | Set the cell to 0 | |
guuu | . | Print the low byte of the cell |
gaaa | , | Read a byte into the cell |
gagu guga | [ ] | Loop while the cell is not 0 |
Case does not matter. The specification says any other word is an error, but its interpreter drops it.
Example
The sum of two numbers reads two bytes and pours the first into the second.
The sum of two numbers reads two bytes and pours the first into the second. A space is 32 and A is 65, so it prints 97, which is a.
A cat has to set the cell to 0 before each read. Without unga the last byte would stay in the cell and print forever.
The Hello World is 1,105 words. It counts eleven cells up to Hello World with 1,052 aaag, walks back and prints them, then adds 10 to a twelfth cell for the line feed.
Further
- esolangs.org/wiki/Babylang
- Brainfuck, the language underneath
Ideas it shows
See also
Babylang builds on Brainfuck.
Brainfuck derivatives
Cell-based
Write your own in Run Convert a program from Babylang
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: babylang.
Command line
shib run babylang -e 'gaaa gaga gaaa gugu gagu uuug gaga aaag gugu guga gaga guuu' --input ' A'shib manual babylangSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/babylang.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org