aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordan <[email protected]>2023-05-25 11:33:14 -0400
committerdan <[email protected]>2023-05-25 11:33:14 -0400
commit742bcacc541e76ea2a982a8f14aafe48aae33dec (patch)
tree5141b2db71b1cf660d1aefea7031fee9a84c97c8
parent40e23d550506659f7a33057bbbc23cb1cf0632f1 (diff)
downloadforth-742bcacc541e76ea2a982a8f14aafe48aae33dec.tar.gz
forth-742bcacc541e76ea2a982a8f14aafe48aae33dec.tar.bz2
forth-742bcacc541e76ea2a982a8f14aafe48aae33dec.zip
docs: update readme.md ; add run-rlwrap makefile command; add rlwrap completions file
-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