We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.
MOOD
MOOD (Memetically Orchestrated Operational Dialect) is a stack-based esoteric language where programs are built ONLY from two-character ASCII emoticon tokens and the facial expressions conveyed by the emoticons are intended to mimic the operation their tokens perform inside the program.
MOOD is designed to be an intuitive, playful language for learning and exploring programming and computational concepts such as operators & precedence, the difference between strings and ints, the concept of variables & binding, parsing, as well as more adept concepts such as inline, tokenization, stacks, etc.
The language is built around a simple Python interpreter that reads and tokenizes sequences of paired characters.
Check the official repository to try it out!
Concepts
MOOD is intentionally simple, but exposes a number of foundational programming and language-design concepts:
Stacks: stack-based evaluation, push/pop semantics, and why stack machines model computation simply. Tokenization & Parsing: how paired-character tokens are recognized and turned into operations. Execution Modes: difference between text-mode and exec-mode, including inline execution behavior. Operators & Precedence: how operator ordering and implicit grouping affect results. Control Flow: loops, conditionals, checkpoints, and simple flow control constructs. Variables & Binding: naming, assignment, multi-part identifiers, and lookup semantics. Data Types: strings vs integers and simple conversion rules. Randomness & Nondeterminism: range-based random values and testing considerations. Interpreter Engineering: building an evaluator, REPL behavior, testing, and embedding in other tools.
Dictionary
Common Text Tokens
| Command | Description |
|---|---|
:>
|
lowercase letter (by run length) |
:D
|
uppercase letter (by run length) |
:<
|
number (by run length) |
:|
|
separator (no output in text mode) |
:v
|
read variable name and output its value (if defined); otherwise outputs the name itself |
Block Control
| Command | Description |
|---|---|
;)
|
switch to execution mode |
:x
|
flush the current block |
:O
|
mark the current block to print when it flushes |
Operators
Arithmetic
| Command | Description |
|---|---|
:)
|
add |
:(
|
subtract |
:]
|
multiply |
:[
|
divide |
:}
|
exponent |
:{
|
square root (integer) |
Comparison
| Command | Description |
|---|---|
C:
|
equals |
:c
|
not equal |
:C
|
strict not equal (value or type) |
o:
|
greater than |
:o
|
lesser than |
Control
| Command | Description |
|---|---|
:/
|
if |
:\
|
else |
:T
|
loop |
:s
|
random |
:X
|
clear stack |
Separators
| Command | Description |
|---|---|
:#
|
concatenate text to execution |
:|
|
concatenate tokens |
(Check the docs for more details)
Examples
:O:>:>
b
:O:<:<:<
3
:O:D:D:D:D:D:D:D:D:|:>:>:>:>:>:|:>:>:>:>:>:>:>:>:>:>:>:>:|:>:>:>:>:>:>:>:>:>:>:>:>:|:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>
Hello
:O:>:|:>:>:|:>:>:>:P:|:<:|:<:<:|:<:<:<
abc 123
:O;):<:<:):<:<:]:<:<:< | (2+2x3)
8
:O:<:<:):<:<:]:<:<:< | (same as above but with no execution)
2+2x3
:O;):<:<:):<:<:x:O;):<:<:]:<:<:x | (2 + 2 | 2 x 2)
4 (two times)
:<:<:|:>:> | (2b)
N/A (Nothing was printed. Saved in stack only.)
:O;):<:<:<:<:<:<:<:<:<:<:<:<:):<:<:<:<:#:> | (12 + 4 and 'a')
16a
:O;):<:<:<:<:<:<:<:<:<:<:<:<:]:{:<:<:<:<:):<:<:<:<:<:<:<:<:[:<:<:<:<:<:<:<:<:< | (12 x √4 + 8 / 9)
24
;):>c::<:<:<:>:>c::v:>:O:v:>:> | (a = 3, b = a. Print 'b')
3
;):>:>:>:|:>c::>:>:|:>:O:v:>:>:>:|:> | (ca = ba. Print 'ca')
ba
:>:>:>:|:>c::<:<:<:>:>:|:>c::<:<:x:O:>:>:>:|:>:|:>:>:P;):v:>:>:>:|:>:):v:>:>:|:>:x | (ca = 3, ba = 2. Print the word "cab" and the result of "ca" + "ba")
cab 5
;):>c::<:>:>c::<:<:/:v:>:>o::v:>:v:>:>:>c::D:D:D:|:>:|:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:\:v:>:>:>c::<:<:<:<:O:v:>:>:> | (a = 1, b = 2, if b > a, c = "Cat", else c = 4. Print 'c')
Cat
:O;):s:<:):<:<:<:<:<
[random number between 0 and 5]