aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2024-06-15 21:13:42 -0400
committerClyne Sullivan <clyne@bitgloo.com>2024-06-15 21:13:42 -0400
commitc278aa4e696359764848edd66c6bb457e248d43e (patch)
tree7ea9fc21666f1e0abc09799ef9e5c7b1d0b3346b
parent6be79eda61b3c64b38528c023845991a0cb4a274 (diff)
readme update; use CC in Makefile
-rw-r--r--Makefile4
-rw-r--r--README.md4
-rw-r--r--support.c2
3 files changed, 6 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index caa1558..fcba1f5 100644
--- a/Makefile
+++ b/Makefile
@@ -10,8 +10,8 @@ main: $(subst .cpp,.o,$(CXXFILES))
prog: main test.fp
./main < test.fp > forsp.ir
llc -march=x86 -filetype=obj --relocation-model=pic forsp.ir -O1
- clang -c support.c -m32 -Os
- clang support.o forsp.ir.o -m32 -Os
+ $(CC) -c support.c -m32 -Os
+ $(CC) support.o forsp.ir.o -m32 -Os
clean:
rm -f a.out main *.ir *.o
diff --git a/README.md b/README.md
index 11c76e9..da2908c 100644
--- a/README.md
+++ b/README.md
@@ -7,11 +7,13 @@ forspll features:
* Lisp-style S-expression syntax
* Forth-style data stack for parameters/values
* Linking with C functions (see `support.c`)
+* Recursion: `$self` gets pointer to current function
Missing features:
+* Captured variables: Functions/lambdas are *not dynamic* and do not capture the state of previously declared variables
* Quote operator: `quote`/`'`
-* Lists and atoms or any dynamic allocations
+* Built-in dynamic allocations (implement them via platform-specific `support.c`)
## Building
diff --git a/support.c b/support.c
index 44a39e4..44b4583 100644
--- a/support.c
+++ b/support.c
@@ -43,7 +43,7 @@ void eq()
void cons()
{
int32_t *st = &stack;
- int32_t *pair = malloc(2 * sizeof(int32_t));
+ int32_t *pair = (int32_t *)malloc(2 * sizeof(int32_t));
--sp;
pair[0] = st[sp];
pair[1] = st[sp - 1];