Alumin
Twenty-six commands, one for each lowercase letter, and numbers are written as runs of h.
Conor O'Brien · Turing complete: unknown · ●●○ moderate
Tested with 6 known programs · Hello World on Try It Online: identical except the line end · Test method
Run it
The idea
Conor O'Brien made Alumin as a stack language that uses only lowercase letters. There are no digits: a run of n h pushes n, so 7 is hhhhhhh, and bigger numbers are built with t to multiply and a to add. Its Hello World is 108 letters long.
The machine
A stack of whole numbers. This implementation follows the Ruby interpreter at github.com/ConorOBrien-Foxx/Alumin, which TIO runs. When the program ends, the stack is printed, one item per line.
| Code | Does |
|---|---|
h run, z | Push its length, push 0 |
a t | Add, multiply |
c g b | Second minus top, divided by top, modulo top |
e u v | Equal as 1 or 0, the larger, the smaller |
d k y r l | Duplicate, drop, swap, reverse, push the length |
i j | Read a character, read a line as a number |
n o | Print a number, print a character |
q … p | Loop while the top is positive |
f … f | Fold the stack with the commands between |
m … m | Map the commands over every item |
w s | Move the top n items to a new stack; bring the old one back |
x | A random number below the top |
This implementation uses a fixed-seed generator for x so a run can be replayed, and leaves out x on 0, which gives a random fraction.
Example
The first squares 7.
The first squares 7. The second counts down from 3: print the top, subtract 1, and loop while it is positive; the 0 that stops the loop is printed as the leftover stack. The third pushes 1 to 6, with spaces to keep the runs of h apart, and folds them with a.
Patterns it teaches
- Stack machines: every command works on the top of one stack.
- Code golf: an alphabet of 26 commands with no digits at all.
Further
See also
Also in Golfing
Write your own in Run Convert a program from Alumin
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: alumin.
Command line
shib run alumin -e 'jjan' --input '20
22
'shib manual aluminSource
- Module
langs/tio/ports.js- Interpreter
langs/tio/alumin.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language