IWANNADIE
Assembly lines with nested calls, where the only way to read a variable is to add 0 to it.
Antikore, 2021 · Turing complete: unknown · ●●○ moderate · esolangs.org
Tested with 4 known programs · Test method
Run it
The idea
Antikore wrote IWANNADIE in Python in 2021, after assembly code and bash. The aim was to be as confusing as possible without giving single letters arbitrary jobs. Every program has to end with die.
Read the story
A line is a command and its arguments, split by commas. An argument can be another command in square brackets, so most of the work happens in nested calls such as [int [add #n, 0]]. A variable cannot be read on its own. add stores its sum back into a variable named first and also returns it, so [add #n, 0] is how a program gets at a value.
The machine
| Command | Does |
|---|---|
set #v, x | Store x |
add mul div mod | Float arithmetic, stored back into a #variable named first |
@name | A marker |
goto "name" goif "name", b | Jump to a marker, always or when b is true |
doif b | Skip the next line when b is false |
comp check | Greater than; equal |
not and or | Logic |
len char text int floor round random | Strings and numbers |
input "prompt" | Print the prompt, read a line |
print x | Print a value and a line feed |
die | End the program |
Numbers are Python floats, so a sum prints as 5.0. The programs in the specification wrap each number in int before they print it.
Example
The factorial keeps 5 in #org, counts #num down and multiplies #res by it each time, until #num is 1.
The factorial keeps 5 in #org, counts #num down and multiplies #res by it each time, until #num is 1.
The truth-machine reads a line and compares it with "0". A string and a number compare as numbers, so the input 0 jumps to @zero; on 1 it prints 1 forever.
The specification also has FizzBuzz up to 100 and 99 bottles of beer, both of which are implemented.
Further
Ideas it shows
See also
Also in Hostile
Write your own in Run Convert a program from IWANNADIE
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: iwannadie.
Command line
shib run iwannadie -e 'print "Hello, World!"
die'shib manual iwannadieSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/iwannadie.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org