From 83aa5bd4d35ec88cbead3a6230665da66b1f9f34 Mon Sep 17 00:00:00 2001 From: sudoer777 Date: Sat, 30 Sep 2023 01:58:05 -0500 Subject: [PATCH] Update readme and examples --- README.md | 10 +++++++++- example/1 | 1 - example/1.fs | 1 + example/2 | 1 - example/2.fs | 1 + 5 files changed, 11 insertions(+), 3 deletions(-) delete mode 100644 example/1 create mode 100644 example/1.fs delete mode 100644 example/2 create mode 100644 example/2.fs diff --git a/README.md b/README.md index e6b3a8f..12c0966 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,17 @@ Main repo: https://git.sudoer.ch/me/really-bad-compiler-in-haskell ## Run Instructions -- Use `stack run ` to run the program (for example, `stack run example/1`). +- Use `stack run ` to run the program (for example, `stack run example/1.fs`). - The LLVM will be generated as `a.out.ll`, and the executable will be generated as `a.out`. +## Language + +It is planned to be similar to Forth, unless it turns out that Forth does not have the features I am looking for. + +Currently, it supports positive integers, `+`, `-`, `*`, `/`, and `.` (pops from stack and outputs to console). + +The supported syntax for this compiler aims to be compatible with Gforth. + ## To edit I recommend using VSCodium, which is preconfigured to have syntax highlighting and (currently broken) debugging features and will automatically suggest the Haskell extensions to install. diff --git a/example/1 b/example/1 deleted file mode 100644 index 0f9d1ef..0000000 --- a/example/1 +++ /dev/null @@ -1 +0,0 @@ -5*3+2 \ No newline at end of file diff --git a/example/1.fs b/example/1.fs new file mode 100644 index 0000000..6d68bd2 --- /dev/null +++ b/example/1.fs @@ -0,0 +1 @@ +5 3 * 2 + . \ No newline at end of file diff --git a/example/2 b/example/2 deleted file mode 100644 index 50f4893..0000000 --- a/example/2 +++ /dev/null @@ -1 +0,0 @@ -6+8/3 \ No newline at end of file diff --git a/example/2.fs b/example/2.fs new file mode 100644 index 0000000..bf084c4 --- /dev/null +++ b/example/2.fs @@ -0,0 +1 @@ +6 8 3 / + . \ No newline at end of file