esolang

9f87m4atttaaaou;

A stack language whose every program looks like someone fell asleep on the keyboard.

CosmicMan08 · Turing complete: yes · ●●○ moderate · esolangs.org

Tested with 5 known programs · Test method

Run it

Expected: Hello, World!

The idea

CosmicMan08 made 9f87m4atttaaaou;, pronounced Mashed Potatolang, so that any program in it would look like a keyboard mash. Every command is one lower case letter, a digit or a punctuation mark, and its programs are single unbroken runs of them. The name of the language is itself a program. It loops nine times and prints a random character from ? to Z each time.

The machine

One stack of numbers. In the table a is the top and b the value under it.

CommandDoes
0 to 9Push the digit
a s m d e %Push a+b, a-b, a*b, a/b, a to the power b, a mod b
p u v nAdd 1, take 1, square root, logical not
g lPush 1 if a>b, if a equals b
c r z jDuplicate, drop, swap, push the depth
x yBring the value at a position up; insert a value at a position
i , qRead a byte, a number, a line
o . _Print a character, a number, the whole stack
f ... ;Loop while the top is not 0; k leaves it
w ... :Loop while the top is 0; ' leaves it
b h tJump to a position in the program; halt; push 1 to 10 at random
^Turn reading off and on, for comments

The loops look at the top without popping it. Positions count from the bottom of the stack, from 0.

Example

The optimized Hello World.

The optimized Hello World. 29pe makes 10 to the power 2, and p turns the 100 into e.

The truth machine. On 0 the f loop is skipped and the last . prints the 0; on 1 it prints 1 forever.

Expected: 0

A calculator reads a number, an operator and a number. It subtracts the operator's code from 42, the code of *, and walks a row of w loops that each add the gap to the next operator.

Expected: 42
Expected: 6

The first Hello World spells Hello World without the comma and the exclamation mark. The optimized one is the version that prints all of it.

Patterns it teaches

Further

Stack-based

Write your own in Run Convert a program from 9f87m4atttaaaou;

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run 9f87m4atttaaaou -e ',fc.;.' --input '0'
shib manual 9f87m4atttaaaou

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/9f87m4atttaaaou.js

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

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