aboutsummaryrefslogtreecommitdiff
path: root/rip-lang.txt
diff options
context:
space:
mode:
Diffstat (limited to 'rip-lang.txt')
-rw-r--r--rip-lang.txt36
1 files changed, 36 insertions, 0 deletions
diff --git a/rip-lang.txt b/rip-lang.txt
new file mode 100644
index 0000000..2c553cd
--- /dev/null
+++ b/rip-lang.txt
@@ -0,0 +1,36 @@
+Rip -- a stack-based rip language
+=================================
+
+All stack items are integers, of unspecified but constant size
+
+0-9: push value
+p: pop
+s: swap
+D: duplicate
+i: increment
+d: decrement
+r: pops the number of items to rotate clockwise
++ - * /: just what you expect
+> < =: comparisons; booleans are 1 and 0, as you expect
+[ ... ]: syntactical; a codeblock
+I: pops boolean, conditionally executing the codeblock that should follow the I, depending on the boolean (aka "if")
+W: I, but then "while" instead of "if"
+o: outputs the top value as an ascii char
+O: outputs the top value as a number
+whitespace: nop
+
+
+Any error causes the interpreter to exit, saying "rip".
+
+
+Example code
+------------
+
+Fibonacci:
+
+01
+1W[
+ DO
+ 9io
+ D3r+
+1]