A lisp-like language (work in progress) implemented in C for 32-bit platforms.
- Have fun.
- Learn about lisp.
- An interactive REPL for devboards.
- ...
- heap consisting of cons-cells with mark and sweep garbage collection.
- Built-in functions: cons, car, cdr, eval, list, +, -, >, <, = and more.
- Some special forms: Lambdas, closures, lets (letrecs), define and quote.
- 28-Bit signed/unsigned integers and boxed 32-Bit Float, 32-Bit signed/unsigned values.
- Arrays (in progress), string is an array.
- Compiles for, and runs on linux-x86 (builds 32bit library, runs on 32/64 bit).
- Compiles for, and runs on Zynq 7000.
- Compiles for, and runs on STM32f4.
- Compiles for, and runs on NRF52840.
- Compiles for, and runs on ESP32.
- Quasiquotation (needs more testing).
LispBM's internals are documented as a series of blog posts.
- (DONE) Write some tests that stresses the Garbage collector.
- (DONE) Implement some "reference to X type", for uint32, int32.
- (DONE) Write a small library of useful hofs.
- (DONE) Improve handling of arguments in eval-cps.
- (DONE) Code improvements with simplicity, clarity and readability in mind.
- (DONE) Implement a small dedicated lisp reader/parser to replace MPC. MPC eats way to much memory for small platforms.
- (DONE) Port to STM32f4 - 128K ram platform (will need big changes). (surely there will be some more bugs)
- (DONE) Add STM32f4 example code (repl implementation)
- (DONE) Port to nrf52840_pca10056 - 256k ram platform (same changes as above).
- (DONE) Reduce size of builtins.c and put platform specific built in functions elsewhere. (Builtins.c will be removed an replaced by fundamentals.c)
- (DONE) Implement 'progn' facility.
- (DONE) Remove the "gensym" functionality havent found a use for it so far and it only complicates things.
- (DONE) Add NRF52 example repl to repository
- (DONE) Update all example REPLs after adding quasiquotation
- Test all example REPLs after addition of quasiquotation
- Add ESP32 example repl to repository.
- Recursion to Iteration. Where it is possible turn recursive function calls into iterations (Implementation).
- Test on all platforms after big changes to eval_cps.c.
- Implement some looping structure for speed or just ease of use.
- Be much more stringent on checking of error conditions etc.
-
Build the library:
make
-
Build the repl:
cd repl-cps
and thenmake
-
Run the repl:
./repl
-
Source your vivado settings:
source <PATH_TO>/settings.sh
-
Build library for ARM A9:
PLATFORM=zynq make
-
Create a standalone app in Vivado SDK (helloworld template is a good starting point)
-
Go to menu: Project > Properties > Tool settings > ARM v7 gcc linker > Miscellaneous and add in OTHER OBJECTS the path to liblispbm.a (build/zynq/liblispbm.a)
-
Go to menu: Project > Properties > Tool settings > ARM v7 gcc compiler > Directories and add in INCLUDE DIRECTORIES the path to the include directory.
-
Go to menu: Project > Properties > Tool settings > ARM v7 gcc compiler > Miscellaneous and add
-D_32_BIT_
to "Other flags" -
Go to menu: Xilinx > Generate linker script and set up for enough of heap and stack. 128MB heap and 16MB stack is an ok starting point.
-
Remove the helloworld.c file from the project and replace with repl-zynq/repl.c
-
build and run.