esolang

DubDubMachine

A brainfuck of emoji, made for a WWDC scholarship. A thumbs up adds, and a keycap says how much.

thisIsTheFoxe, 2019 · Turing complete: with unbounded memory · ●○○ easy · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: WWDC

The idea

thisIsTheFoxe made DubDubMachine in 2019 for a WWDC scholarship application, which gave it its name. The author names l33t as the model for its commands. Each emoji that changes a cell or moves the pointer takes a number right after it, one of the eleven emoji from 0️⃣ to 🔟, so 👍🔟👍7️⃣ adds 17. The loop emoji and the stop were picked for the theme of WWDC19. Input, 🎙, was not in the first implementation.

Read the story

The machine is small. It has 8 cells of one byte each, and the specification says that keeps it from being quite Turing complete.

The machine

EmojiDoes
👍 n, 👎 nAdd n to the cell, or take n away
👉 n, 👈 nMove the pointer n cells forward or back
🎙Read a character into the cell
🎉Print the cell as a character
🤟Jump past the matching 🤘 if the cell is 0
🤘Jump back to the matching 🤟 if the cell is not 0
🤯Stop

Every other character is a comment, so a program can explain itself between the emoji. The specification leaves some things open. A command with no number after it counts 1, cells wrap at 256, moving off the 8 cells is an error, and reading past the end of the input gives 0.

Example

The WWDC program, which it calls probably the first program written in the language.

The WWDC program, which it calls probably the first program written in the language. It loops 17 times to set three cells to 85, 68 and 68, then adds 2 to make W and takes 1 away to make C.

The cat reads a character, then prints it and reads the next until it reads 0. Eight times nine makes 72, an H.

Expected: cat
Expected: H

The truth machine is translated from brainfuck, with a 👉 and a 👍 that have no number. Read as 1, they make it print its input once and stop, also on 1.

Patterns it teaches

  • Turing tarpit: brainfuck's commands, each with a count, on a tape too short to be Turing complete.

Further

DubDubMachine builds on Brainfuck.

Brainfuck derivatives

Cell-based

Write your own in Run Convert a program from DubDubMachine

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run dubdubmachine -e '🎙🤟🎉🎙🤘🤯' --input 'cat'
shib manual dubdubmachine

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/dubdubmachine.js

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

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