esolang

DODO

Every word pushes a number, the instructions too. Nothing happens until DO runs the number on top.

QuantumV, 2026 · Turing complete: yes · ●●○ moderate · esolangs.org

Tested with 3 known programs · Test method

Run it

Expected: Hello, World!

The idea

QuantumV made DODO in 2026, a stack language inspired by FORTH and BASIC. Almost everything in it is a number on the stack. An instruction such as OUTN does not run when it is read. It pushes its opcode, 50, and the word DO pops that number and runs it. So * and 12 are the same word, and a program can push several instructions and run them later.

Read the story

Strings go on the stack as a 0 with the characters above it and the first character on top, like a C string turned upside down.

The machine

WordsOpcodes
NOP DUP POP SWAP OVER LEN0 to 5
+ - * / % = > <10 to 17
SET VAR ALIAS BUF BUFALIAS SETBUF DEL GET LABEL DELLABEL20 to 29
GOTO GOSUB RET JZ JNZ40 to 44
OUTN OUTC OUTS OUTB INPUTS INPUTN INPUTC50 to 56
SLEEP TIME60 and 61

@NAME: marks a label, ; starts a comment, and any other word pushes the value of the variable with that name. Instructions that need a name, such as VAR and GOTO, take it as a string from the top of the stack. { and } are the constants 6 and 7, which mark the ends of a buffer. This implementation leaves out IMPORT, which reads files, and TIME, which reads the clock.

Example

* pushes 12, so writing 12 does the same.

* pushes 12, so writing 12 does the same.

Expected: 42

The truth machine. JNZ takes the label's name and then the number it tests, and jumps back while that number is 1, as the specification says.

Expected: 0

The Fibonacci starts with 0 "A" VAR and 1 "B" VAR and only then DO DO, so B is made before A. Its 99 bottles of beer, by Doeimos, runs in full.

Patterns it teaches

  • Stack machines: even the instructions wait on the stack.
  • Code as data: an instruction is a number that can be computed, kept and run later.

Further

Also in Functional and concatenative

Write your own in Run Convert a program from DODO

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run dodo -e '"Hello, World!" OUTS DO'
shib manual dodo

Source

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

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

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