WARP
WARP And Run Program, so called because the interpreter is expected to scramble the source after every command.
Aldous zodiac, 2013 · Turing complete: unknown · ●●○ moderate · esolangs.org
Tested with 8 known programs · Test method
Run it
The idea
Aldous zodiac made WARP in May 2013. Every command is one punctuation mark followed by its operands, with no spaces needed, so programs read like line noise. =se24E0 sets the object se to 24E0. Numbers are written in base 36 unless the program changes the radix, so 24E0 is 99000, and +A switches to base 10.
Read the story
Values live in objects, named by two lower case letters, and on a stack of stacks. %aa turns the text of object aa into a new stack of characters, which is how WARP walks through a string. The name promises that the interpreter shuffles the source after each command and keeps a map to unscramble it. Only ~ (the source) and ` (the map) can see that, so this implementation leaves the source as it is. The random access stack, { and }, is not built.
The machine
| Command | Does |
|---|---|
=xy e | Assign |
>xy e <xy e &xy e $xy e #xy e | Add, subtract, multiply, divide, modulus; with ! on the stack |
:a:b ?e?cmd | Compare and push -1, 0 or 1; pop and run cmd if it equals e |
* ] ! ; | Push, replace the top, pop, duplicate |
%xy \| ' | Treat an object as a stack, drop it, swap the top two stacks |
@name ^e name | Label; jump if e is not zero or empty, ^.name always |
(e )e | Print as a character, print as it is |
,l ,c | Read a line, read a character |
+n | Set the radix |
Example
The two Hello Worlds.
The two Hello Worlds. The second turns the text into a stack and pops it a character at a time while the stack _ is not empty.
The Fibonacci prints in base 36, so 13 is D and 55 is 1J. The counter li starts at 1Z, which is 71.
Further
Ideas it shows
See also
Object-oriented paradigm
Write your own in Run Convert a program from WARP
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: warp.
Command line
shib run warp -e ')~'shib manual warpSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/warp.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org