esolang

Monky

FORTH squeezed into one character per word, so a small 8-bit machine can run it fast.

Menguinponky, 2026 · Turing complete: unknown · ●●○ moderate · esolangs.org

Tested with 7 known programs · Test method

Run it

Expected: 2

The idea

Menguinponky designed Monky over a weekend in 2026, after FORTH, FALSE and C. Every printable ASCII character has a job. The symbols are picked to look like what they do. $ starts like swap, _ is the floor you drop a value to, @ is a rotation and # counts.

Read the story

Two habits set it apart. A comparison takes only the top and keeps the value below it, so one value can be tested against many cases in a row. And . prints the top without taking it, so it can go anywhere as a debug print.

The machine

Symbols are separated by spaces. A number pushes itself, a letter pushes its character code, and "text" pushes a 0 and then the text in reverse, first character on top.

SymbolDoes
_ % $ ^ @Drop, dup, swap, over, rot
# \Push the depth; copy the item n down, 0 being n itself
+ - * / & \| ~ ` | Arithmetic and bitwise, ` is xor
= < >Compare the item below with the top, replacing the top by -1 or 0
. , 'Print the top as a number and keep it; print and drop a character; read one
? !Skip the next symbol if the popped value is true, or false
( )( jumps past its ) unless it is skipped
[ ]] jumps back to its [ unless it is skipped
{ }Mark a function body and jump past it; } returns
: ;Store or load variable a to z or a negative data index; name or call function A to Z

Blocks and loops may overlap, because each bracket pairs only with its own kind. Functions may call other functions but not themselves. Integers have no bound, . prints no separator, and reading past the end of the input ends the run.

Example

Modulo, 12 mod 5, with two overs.

Modulo, 12 mod 5, with two overs.

A while loop where the block ( and the loop ] overlap. While the top is not 0, ? skips the ( and the body runs.

Expected: 54321

The Hello world loop prints the string's closing 0 too, as a NUL byte. Testing before printing stops in time.

Expected: hellorld
Expected: 0

The quine keeps its own text as a string and prints it twice through function P, once between quotes.

Expected: "{ 1 [ \ % ? ( , 1 + ] ) _ _ } P : 34 , P ; 34 , 32 , P ;" { 1 [ \ % ? ( , 1 + ] ) _ _ } P : 34 , P ; 34 , 32 , P ;

Patterns it teaches

  • Stack machines: FORTH's words, one character each.
  • Quine: a string printed twice by one function.

Further

Also in Functional and concatenative

Write your own in Run Convert a program from Monky

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run monky -e '3 .'
shib manual monky

Source

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

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

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