aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--makefile7
-rw-r--r--readme.md15
-rw-r--r--rlwrapcompletions.forth19
3 files changed, 36 insertions, 5 deletions
diff --git a/makefile b/makefile
new file mode 100644
index 0000000..db42381
--- /dev/null
+++ b/makefile
@@ -0,0 +1,7 @@
+build:
+ gcc forth.c optable.c stack.c -o forth
+run:
+ ./forth
+run-rlwrap:
+ rlwrap -r -f rlwrapcompletions.forth ./forth
+
diff --git a/readme.md b/readme.md
index bcc8cad..42a0877 100644
--- a/readme.md
+++ b/readme.md
@@ -2,9 +2,14 @@ Forth-style Stack Language with C and JS implementations.
JS implementation can be run by opening index.html in a web browser or running `node forth.js`.
-C implementation can be compiled with gcc (`gcc forth.c -o forth`) and then run `./forth`.
+Assuming you have gcc and make installed, the C implementation can be built with `make build`, then run with `./forth`.
+
+If you also have rlwrap installed, you can run `make run-rlwrap`, to get completions, history, and more pleasant line-editing.
+
+_Be aware:_
+
+ - Neither implementation is finished
+ - The instruction sets have _different_ missing features
+ - This is a toy language, not intended for serious use
+
-Be aware:
-- Neither implementation is finished
-- The instruction sets have _different_ missing features
-- This is a toy language, not intended for serious use
diff --git a/rlwrapcompletions.forth b/rlwrapcompletions.forth
new file mode 100644
index 0000000..80e9a36
--- /dev/null
+++ b/rlwrapcompletions.forth
@@ -0,0 +1,19 @@
+pop
+push
+peek
+if
+then
+:
+;
++
+-
+*
+/
+dup
+dump
+not
+=
+swap
+drop
+over
+rot