Slam
A program is a slam poem. Each line means the product of the lengths of its words.
ArthroStar11, 2021 · Turing complete: unknown · ●●○ moderate · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
ArthroStar11 made Slam in 2021 so that programs read like slam poetry, in the spirit of Beatnik and Length. Only word lengths count, punctuation included. Hey you be! is 3 times 3 times 3, which is 27, the command that prints a character. Arguments are lines too, so Lovely!! greetings stands for 8 times 9, the code of H. Every opcode is a composite number, so it can be written with more than one word. Each stanza is a subroutine, and the first stanza is the main program.
The machine
| Number | Does |
|---|---|
| 4 n | Call stanza n |
| 6 | Return |
| 8, 9 | Loop start and end, while the boolean is true |
| 10, 12, 14 a b | Boolean = variable a =, >, < variable b |
| 15 | Invert the boolean |
| 16, 18, 20, 21, 22 a b | Hold = a + b, a − b, a × b, a / b, a % b |
| 24, 25 | Read a number or a character into hold |
| 26, 27 | Print hold as a number or a character |
| 28 n, 30 n | Store hold in variable n, load variable n |
| 32 n | Hold = n |
Example
The poem is 32 72, 27, 28 4, 32 1, 28 5, 16 4 5, 27.
The poem is 32 72, 27, 28 4, 32 1, 28 5, 16 4 5, 27. It prints 72, keeps it in variable 4, keeps 1 in variable 5, and prints their sum, 73.
Further
Ideas it shows
See also
Pseudonatural
Write your own in Run Convert a program from Slam
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: slam.
Command line
shib run slam -e 'Oh to be nice
Lovely!! greetings
Hey you be!
Beloved is me
Hark
Love blindly!
I
Hate noone!!
Hark!
To be nice
Hark
Hark!
How you are'shib manual slamSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/slam.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org