esolang

Planes

Every line is a little program of its own, and each one remembers where it stopped.

WhirlELW, 2025 · Turing complete: no · ●●○ moderate · esolangs.org

Tested with 4 known programs · Test method

Run it

Expected: Hello, World!

The idea

WhirlELW made Planes in 2025. It is two dimensional, but the program counter never moves up or down. Each line is a plane, and a plane keeps its own program counter. Jump to another plane and back, and the first plane goes on from where it left off. The specification notes that this resembles Fish, though the author had never looked at Fish.

Read the story

One stack serves every plane. A link register holds the number of a plane, which is how a plane can be called and then send the run back to its caller.

The machine

CharDoes
'XPush the character X
# .Read a character; pop and print one
: ~ %Duplicate, drop, swap
+ -Add; subtract the top from the one below
( ... )Run again while the top is not 0, tested at )
?Skip the next instruction when the top is 0
< > hGo one plane back, one forward, or to the first plane
= $The same as < and >, but rewind the plane being left
& *Keep the active plane's number in the link register; push it
^ @Pop a plane number and go there; @ rewinds the plane being left
HHalt

Planes count from 0, the first line. Every other character does nothing. The specification puts Planes among the pushdown automata, since the link register can only hold a plane number.

Example

The Hello World.

The Hello World. Its last instructions push 2 and ( and subtract them, which gives 10, a line feed.

The countdown. The loop prints the digit and a line feed and takes 1 from the count, which '['Z- makes as 91 minus 90. When the count reaches 0 the loop ends and the rest prints BOOM!.

Expected: 9 8 7 6 5 4 3 2 1 BOOM!

The truth machine branches with a plane. On 0 the ? skips the > and the run halts. On 1 it goes to the second plane, which prints 1 for ever.

Expected: 0

The 99 bottles of beer calls a plane for each part of a verse and comes back through the link register. It counts in two digits, so it sings from 99 down to 00 and ends on a count of /Z. The specification calls it not perfect but good enough.

Patterns it teaches

Further

Two-dimensional languages

Stack-based

Write your own in Run Convert a program from Planes

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run planes -e '#:.'\''0-?>~H
~'\''1(:.)' --input '0'
shib manual planes

Source

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

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

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