Minkolang
A 2D language with time as a third dimension. On a space, the pointer falls to the next layer.
El'endia Starman, 2015 · Turing complete: unknown · ●●● hard · esolangs.org
Tested with 6 known programs · Hello World on Try It Online: identical except the line end · Test method
Run it
The idea
Minkolang dates from 2015 and calls itself the Minkowskian (2+1)D semi-golfing language. The code has rows and columns like Befunge, and also layers, separated by lines of $$$. The layers are the time axis. When the pointer lands on a space it does not move on through space; it falls through time, into the same cell of the next layer. Every direction wraps around, layers too.
Read the story
So a space is never a plain no-op. In a program of one layer a stray space catches the pointer for good, because it falls back onto the same cell. V boosts the pointer across spaces, and # is a net with no effect but to be something other than a space.
Loops have their own stacks. ( hands the loop the whole stack of its parent, or with $ only the top n values, and the loop gives what is left back when it ends. { and } are recursion, rare in a 2D language.
The machine
One stack of Python numbers, with endless zeros below. $ toggles the next command to a second meaning.
| Char | Does |
|---|---|
"..." 0-9 l | Push a string (first character on top), a digit, ten |
+ - * : ; % | Add, subtract, multiply, floor divide, power, modulo |
= ` | Equal, greater | |
~ , | Negate, not |
n o N O | Read a number or a character, print a number and a space, print a character |
d D g G c x X r R s S I | Duplicate, index, copy, drop, reverse, rotate, sort, length |
v < > ^ / \ _ \| | Arrows and mirrors |
! ? @ & | Jump one cell, if true, n cells, n cells if true |
b B | Turn back if false, or bend left or right |
( ) | While loop with its own stack; ) pops the value it tests |
[ ] i | For loop, and its counter |
{ } | Recursion |
p q a A w F f t C | Code put and get, array, wormhole, gosub, ternary, comments |
V # . | Boost and net; end |
When the run ends, the interpreter prints a newline.
Example
The Hello World from Try It Online pushes the string and prints its 13 characters one at a time.
The Hello World from Try It Online pushes the string and prints its 13 characters one at a time.
A for loop prints its counter five times. Then the recursive Fibonacci from the specification reads n, calls itself with { on n-1 and n-2 and adds the results.
Patterns it teaches
- Two-dimensional control flow: and a third axis to fall through.
- Stack machines: a stack per loop and per call.
- Self-modifying code:
pwrites into the code.
Further
- esolangs.org/wiki/Minkolang
- The interpreter, in Python
See also
Two-dimensional languages
Stack-based
Write your own in Run Convert a program from Minkolang
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: minkolang.
Command line
shib run minkolang -e '34+N.'shib manual minkolangSource
- Module
langs/tio/ports.js- Interpreter
langs/tio/minkolang.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org