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.
Kpcaaeths
Kpcaaeths is a stack-based esoteric programming language created by User:Yoy in 2026.
The name comes from stack and heap reversed and interleaved: kcats (stack reversed) and paeh (heap reversed) weave into Kpcaaeths.
It has one untyped stack (kcats) and one heap (paeh). Programs are made of commands and arguments, with statements separated by ; or newlines.
Overview
Addresses are counted by mk. Heap addresses are not specified by the program. The first mk is address 0, the second is address 1, and so on. fre deletes an object and shifts later objects down, so addresses change. The programmer must keep count.
op dispatches dynamically. op pops a numeric opcode from the stack, and arguments below it. The opcode determines behavior. This is the only place where a command is a value on the stack; all other commands are static.
There is no dup. Copying the top of the stack requires a temporary heap slot and sfc/loa. This is intentional.
Commands
| Command | Arguments | Description |
|---|---|---|
psh |
<value> |
Push a Num, Ptr, or nil onto the stack
|
pop |
— | Pop the stack top |
add |
— | Pop a, b; push a + b
|
sub |
— | Pop a, b; push b - a
|
mul |
— | Pop a, b; push a * b
|
div |
— | Pop a, b; push b // a
|
mod |
— | Pop a, b; push b % a
|
eq |
— | Pop a, b; push 1 if equal, else 0
|
mk |
<type> |
Create a heap object at the next address: 0 = Int, 1 = Array
|
len |
<ptr> <n> |
Set the length of an Array
|
sto |
<ptr> <value> |
Write a literal value to the heap |
sfc |
<ptr> |
Pop the stack top and write it to the heap |
loa |
<ptr> |
Load a heap value at a literal address onto the stack |
lat |
— | Pop a Ptr; load from that address onto the stack (indirect load)
|
ptr |
— | Pop a Num; push a Ptr with that value
|
fre |
<ptr> |
Delete a heap object; later objects shift down |
lab |
<n> |
Define a label n; does not occupy a pc
|
gto |
<n> |
Unconditional jump to label n
|
giz |
<n> |
Pop the stack top; jump to label n if zero
|
gin |
<n> |
Jump to label n if the stack top is nil (does not pop otherwise)
|
op (with stack top 0) |
— | Pop a ptr; print the string or character in the heap
|
op (with stack top 1) |
— | Read one character; push its code point as Num
|
op (with stack top 2) |
— | Read one character; push Num if digit, else nil
|
op (with stack top 3) |
— | Pop base, pop ptr; convert heap[ptr] to a string in base (2–10) and append a new Array
|
Comments
A statement starting with ' is a comment. Comments may appear at the start of a line or after ;:
loa *0;'this is a comment
Example: Hello, World! × 10
mk 0; sto *0 10; mk 1; len *1 14; sto *1 72; sto *1 101; sto *1 108; sto *1 108; sto *1 111; sto *1 44; sto *1 32; sto *1 87; sto *1 111; sto *1 114; sto *1 108; sto *1 100; sto *1 33; sto *1 10; psh *0; giz 28; loa *1; psh 0; op; loa *0; psh 1; sub; sfc *0; gto 18;
Outputs Hello, World! ten times.
Example: Truth-machine
mk 0;'addr 0: '0' sto *0 48; mk 0;'addr 1: '1' sto *1 49; psh 1; op; psh 48; sub; giz 0; lab 1; psh *1; psh 0; op; gto 1; lab 0; psh *0; psh 0; op;
Input 0 outputs 0 once and halts. Input 1 outputs 1 forever.
Example: Read a number
mk 0; sto *0 0; lab 3; psh 2; op; gin 0; loa *0; psh 10; mul; add; sfc *0; gto 3; lab 0; loa *0; psh 10; psh 3; op; psh *4; psh 0; op
Reads digits until a non-digit, accumulates into heap address 0, converts to a decimal string via op 3, and prints it.
Computational class
Kpcaaeths is Turing-complete.
The ptr command converts a Num to a Ptr, and lat loads from a Ptr taken from the stack. Together they provide indirect addressing: heap[heap[i]] is expressible, so the heap is a true unbounded array.
With an unbounded stack, an unbounded heap, indirect addressing, conditional branches (giz/gin), and unconditional jumps (gto), Kpcaaeths can simulate a Minsky machine or a Turing machine.
Implementation
A Python implementation is available at GitHub.