DubDubMachine

From Esolang
Jump to navigation Jump to search
DubDubMachine
Paradigm(s) imperative
Designed by thisIsTheFoxe
Appeared in 2019
Memory system tape-based
Dimensions one-dimensional
Computational class Turing complete
Major implementations Original PlaygroundBook
Influenced by l33t
File extension(s) .dubdubm

DubDubMachine is a esoteric programming language created in 2019 by ThisIsTheFoxe for a WWDC Scholarship application, hence it's name. It's goal is to show how much fun end exitement esolangs can bring - especially to newcomers.

Language overview

DubDubMachine operates on an array of (normally 8) memory cells, also referred to as the tape. Each cell is initially set to zero. There is a pointer, initially pointing to the first memory cell. There are 20 (originally 19) Emoji which are interpreted as commands. Every other character is ignored and treated like a comment.

Commands

Command Description
0️⃣-πŸ”Ÿ Those 11 Emoji are used to represent numbers in DubDubMachine.
πŸŽ™ IN: (not part of the original implementation) Reads a character from an input and writes is ASCII code into the current cell
πŸŽ‰ OUT: Prints out the value of the current cell as ASCII character
πŸ‘(followed by a number x) INC: Increments the current memory cell by x
πŸ‘Ž(followed by a number x) DEC: Decrements the current memory cell by x
πŸ‘‰(followed by a number x) FWD: Moves the pointer forwards by x
πŸ‘ˆ(followed by a number x) BCK: Moves the pointer backwards by x
🀟 IF: Jumps past the matching 🀘 if the current cell is 0
🀘 EIF: Jumps back to the matching 🀟 if the cell under the pointer is NONzero
🀯 END: Terminates the program immediately

Related

According to the author the commands where influenced by the language l33t. However, many esoteric programming languages use similar commands. The related Emoji also where chosen to represent their actions, which is also common in esolangs (e.g. brainfuck: + = πŸ‘) The Emoji for IF / EIF and END where influenced by the theme of WWDC19.

Examples

Cat program

πŸŽ™πŸ€ŸπŸŽ‰πŸŽ™πŸ€˜πŸ€―

Truth-machine

Based on the brainfuck example.

πŸ‘‰3οΈβƒ£πŸŽ™πŸŽ‰πŸ‘‰πŸ€ŸπŸ€ŸπŸ‘Ž1οΈβƒ£πŸ‘‰1οΈβƒ£πŸ‘1οΈβƒ£πŸ‘ˆ2οΈβƒ£πŸ‘πŸ‘‰1οΈβƒ£πŸ€˜πŸ‘‰1οΈβƒ£πŸ‘Ž1οΈβƒ£πŸ€˜πŸ‘ˆ3οΈβƒ£πŸ€ŸπŸ‘ˆ2οΈβƒ£πŸ€˜πŸ‘‰1οΈβƒ£πŸ€ŸπŸŽ‰πŸ€˜πŸ€―


WWDC

Probably the first program to ever been written in this language by the author. It prints the string "WWDC".

πŸ‘πŸ”ŸπŸ‘7️⃣   init cell 1 with 17
🀟         loop start
πŸ‘Ž1️⃣       decrement x
πŸ‘‰1️⃣
πŸ‘5️⃣       add 5 to cell 2
πŸ‘‰1️⃣
πŸ‘4️⃣       add 4 to cell 3
πŸ‘‰1️⃣
πŸ‘4️⃣       add 4 to cell 4
πŸ‘ˆ3️⃣       back to cell 1
🀘
πŸ‘‰1️⃣
πŸ‘2️⃣       add 5 to cell 2
πŸŽ‰πŸŽ‰       print cell 2 two time
πŸ‘‰1οΈβƒ£πŸŽ‰     print cell 3
πŸ‘‰1️⃣
πŸ‘Ž1οΈβƒ£πŸŽ‰     subtract 1 form cell 4 and print it
🀯          The End ^-^

Computational class

DubDubMachine would be Turing-complete with an infinite amount of memory. However, since it's defined by it's small memory of eight 8bit cells it is not entirely.