esolang

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

Expected: Hello World!

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

CommandDoes
=xy eAssign
>xy e <xy e &xy e $xy e #xy eAdd, subtract, multiply, divide, modulus; with ! on the stack
:a:b ?e?cmdCompare 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 nameLabel; jump if e is not zero or empty, ^.name always
(e )ePrint as a character, print as it is
,l ,cRead a line, read a character
+nSet 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.

Expected: Hello World!

The Fibonacci prints in base 36, so 13 is D and 55 is 1J. The counter li starts at 1Z, which is 71.

Expected: 1 2 3 5 8 D L Y 1J 2H 40 6H AH GY RF 18D 1ZS 385 57X 8G2 DNZ M41 ZS0 1LW1 2LO1 47K2 6T83 B0S5 HU08 SUSD 1AOSL 23JKY 3E8DJ 5HRYH 8W0C0 EDSAH N9SMH 11NKWY 1OXDJF 2QKYGD 4FIBZS 763AG5 BLLMFX IROWW2 UDAJBZ 1D4ZG81 27I9ZK0 3KN9FS1 5S5JFC1 9CSSV42 F4YCAG3 OHR55K5 13MPHG08 1S4GMLKD 2VR641KL 4NVMQN4Y 7JMSUOPJ C7IFLBUH JR58G0K0 VYNO1CEH 1FPSWHCYH 2BOGKIPCY 3RE9H02BF 632Q1IROD 9UGZIITZS FXJPK1LO5 PS0P2KFNX 15PKEMM1C2 1VHL3P6GZZ 3175IBSIC1 4WOQM0YZC0

Further

Ideas it shows

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 warp

Source

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