esolang

'14'

A stack language that can only write the digits 1 and 4.

Marcus 2n2, 2026 · Turing complete: yes · ●●● hard · esolangs.org

Tested with 7 known programs · Test method

Run it

Expected: Hello, world!

The idea

Marcus 2n2 named 14 after its two digits. 1 and 4 append a digit to the number on top of the stack, so 41 pushes 41. Every other number has to be made from those with subtraction, which is the only arithmetic. The stack can also be turned round from either end. Programs by Blashyrkh include an A+B in 88 bytes, a prime generator in 120 and a quine of 1,713 bytes.

The machine

CommandDoes
1 4Pop a, push 10a+1 or 10a+4; on an empty stack push 1 or 4
:Duplicate the top; push 0 on an empty stack
-Pop a and b, push b−a; negate a lone item
/ ... \Skip to the matching \ if the top is 0
( ... )) jumps back to its (
iPush a byte of input, 0 at the end
uPop
o OPop and print as a character or as a number
> <Move the top to the bottom, or the bottom to the top

A loop ends only through /. When a / has no \ to skip to, it skips to the end of the program, so (i/o) is a cat that stops at the end of its input.

Example

The A+B reads two numbers, each ending in a line feed.
Expected: meow
Expected: 42

The A+B reads two numbers, each ending in a line feed. With a space between them instead, it never stops.

Further

Ideas it shows

Stack-based

Write your own in Run Convert a program from '14'

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run 14 -e '(i/o)' --input 'cat'
shib manual 14

Source

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

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

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