WARP

WARP is an object and stack based language, created by User:Aldous zodiac (talk) in May 2013. All numerics are signed, integral and expressed in hexatridecimal (base 36) notation, unless the radix system is changed within an executing program. WARP is a (weak) recursive acronym, WARP And Run Program - so called because it is expected that interpreters randomize the source program after each command is executed.

Objects and expressions
Basic pseudo grammatical terms:
 * ::= [a-z]{2}
 *  ::= -{0,1}[0-9,A-Z]+ | | "...." | ~ | `
 * ::=  | ! | _
 * ::= [a-z]+ |.
 * ::= [a-z]+ |.

Operators
A few general purpose operators exist.

Stack manipulation
There are several commands for stack manipulation.

Labels and movement
WARP supports a simple label/jump set of commands.

Input and output
WARP can interact with any existing input and output mechanisms.

Source access
Access to the source is provided as well as the current traversal map.

Environment and execution
First, the run time environment.

Environment
WARP has initially one, unbound or system, stack. Using the % operator, a bound object can usurp the unbound stack, until the | operator removes it. Think of it is as being similar to a stack of stacks. Issuing a | operator against the unbound stack will mean that the environment enters 'stackless' mode. All further stack based operations will not operate as expected, nor generate an error. There is no formal limit to the size and number of stacks and similarly in relation to source code.

In addition, the WARP environment has a single random access stack, manipulated with the { and } operators.

Note that all WARP objects are shared across the stack of stacks; if an assignment to an object xx occurs, and then a new stack is created, the value of xx will be available in the new stack context.

Compliant interpreters will auto create objects on demand, initialized to zero.

Execution
Each source advance generates a random rewrite of the source, along with an attendant 'unscramble' map. Could be used for amusing output effects.

Examples
Hello World )"Hello World!"

Hello World #2 =aa"Hello World!"%aa@x(!^_x|

Quine )~

99 bottles of beer *"No more bottles of beer on the wall"+A=nb99@f=pl" ":nb:1?1?=pl"s" )nb)" bottle")pl)" of beer on the wall, ")nb)" bottle")pl )" of beer")", Take one down, and pass it around"(13(10!na;<!na=na!se1@r:se:1?1?^.a

Collatz conjecture #2 (stack and objects) =se24E0)"Hailstone sequence for ")se@a)se*se$!2;&!2:!:se?-1?^.o=se!^.r@o!&se3>se1@r:se:1?1?^.a

Primes less than some user entered value +A)"Enter start: ",l=cu!)"Primes <= ")cu)"\n":cu:2?-1?^.e@o*cu$!2=ca!@i*cu#!ca?0?^.nacnu:op:"-"?0?pc1^_m|=bf0=pcps@r{pc=cc!:"]":cc?0?^.l=ad0:"+":cc?0?=ad1:"-":cc?0?=ad-1:">":cc?0?>bf1 :"<":cc?0?!ad}bf@n>pc1{pc:!:0?0?^.e^.r@o{bf(!^.n@l{bf:0:!?0?^.n=xx0@gxx1:xx:1?0?^.n^.g@e

External resources

 * A mostly functional interpreter, along with source code