esolang

O_o

Brainfuck written as a column of raised eyebrows.

BoundedBeans · Turing complete: yes · ●●○ moderate · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: cat

The idea

BoundedBeans made O_o look like the emoticon of the same name, stretched sideways. Every line is a row of capital O, an underscore and a row of small o, and the two lengths carry the program in unary. A line holds 8 bits. Six of them are two brainfuck commands, and the last two are an extra command, *I, which works a stack that sits under every cell of the tape.

The machine

The O before the underscore count one more than the high 4 bits, and the o after it one more than the low 4 bits. So O_o is 00000000, two > and no *I.

BitsBrainfuckBits*I
000 001> <00Nothing
010 011+ -01Push the cell onto its stack
100 101. ,10Pop the stack into the cell
110 111[ ]11Pop and push onto the stack of the cell to the right

A line that starts with 0_ holds a single command and *I as a 5-bit number in its o, which allows an odd number of commands. Popping an empty stack gives 0. Cells are bytes that wrap, and the end of input reads as 0.

Example

The cat is three lines, ,[, ., and a 0_ line with ].

The cat is three lines, ,[, ., and a 0_ line with ].

The hello world is 70 lines long. Its first five lines are >+, ++, ++, ++ and +[, and the loop they open makes the 72 of H.

Patterns it teaches

  • Encoding tricks: two commands and a stack operation packed in one byte, written in unary.
  • Camouflage: the program looks like a wall of surprised faces.
  • Turing tarpit: underneath it is brainfuck.

Further

O_o builds on Brainfuck.

Brainfuck derivatives

Cell-based

Write your own in Run Convert a program from O_o

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: o-o.

Command line

shib run o-o -e 'OOOOOOOOOOOO_ooooooooo
OOOOOOOOOO_ooooo
0_ooooooooooooooooooooooooooooo' --input 'cat'
shib manual o-o

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/o-o.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org