diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2024-06-15 21:13:42 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2024-06-15 21:13:42 -0400 |
commit | c278aa4e696359764848edd66c6bb457e248d43e (patch) | |
tree | 7ea9fc21666f1e0abc09799ef9e5c7b1d0b3346b | |
parent | 6be79eda61b3c64b38528c023845991a0cb4a274 (diff) |
readme update; use CC in Makefile
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | support.c | 2 |
3 files changed, 6 insertions, 4 deletions
@@ -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 @@ -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 @@ -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]; |