Go to file
Benjamin Vedder 9a62433015 Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71
43ebce71 Fix formatting int print.c and constants that default to float/double
fa220f0b update gc statistics collection a small bit
25b20686 fix get_heap_state
783d774e Arrays of 64bit values passes the associated tests. More tests are needed though
ff40d02f working on 64bit arrays. more testing needed
204bea39 CMP as a macro instead of 8 different functions
44bb152d added a set of math extensions grabbed from  Benjamin's bldc repo
9c34b4cd added string extensions from benjamins bldc repo
b4370155 merge in changes on master into dev64bit
c129344b fixed masking bug in fundamentals
ed3ab5be closed down ome warnings when building 64bit
d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values
f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests
4dafbe6c added decoders for 64bit values
63026a8a added 64bit value literals
8c1f0f0f made GC aware of lbm_memory allocated values
17148ada 64 bit values allocated on lbm_memory on 32 bit version
4445e5a8 sketch of encoders for 64 bit values
f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28
840723ca preparations and planning for 64bit types in both 32 and 64 bit versions.
13675dda 64bit up and running. but there are many TODOs
033bfd9a small fixes following bug hunt
f5c984de fix bug in representation of important masks and constants
d40b2437 Merge branch 'master' into dev64bit
06f9603f Merge branch 'master' into dev64bit
69950ba1 32 bit tests are ok
46b6fa28 Merge branch 'master' into dev64bit
b9e2c993 work in progress
8dff9b4d work in progress
a241aded work in progress
4738e0da update year in lbm_types
ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code
85acec30 small tweaks tp create_ctx, use correct type
bf0286a7 Merge branch 'master' into dev64bit
824e1634 Merge branch 'master' into dev64bit
04a97f17 lots of testing needed
ea862cce a bunch of changes in preparation for 64bit compatibility.

git-subtree-dir: lispBM/lispBM
git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 15:47:05 +01:00
benchmarks Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 2022-03-25 15:47:05 +01:00
chibios-examples Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 2022-03-25 15:47:05 +01:00
doc Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 2022-03-25 15:47:05 +01:00
docker Squashed 'lispBM/lispBM/' content from commit 748477b9 2022-01-29 17:26:45 +01:00
examples Squashed 'lispBM/lispBM/' changes from 34faf757..f700e1a7 2022-02-28 13:31:55 +01:00
include Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 2022-03-25 15:47:05 +01:00
mascot Squashed 'lispBM/lispBM/' content from commit 748477b9 2022-01-29 17:26:45 +01:00
notes Squashed 'lispBM/lispBM/' content from commit 748477b9 2022-01-29 17:26:45 +01:00
old Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 2022-03-25 15:47:05 +01:00
platform Squashed 'lispBM/lispBM/' content from commit 748477b9 2022-01-29 17:26:45 +01:00
repl-cps Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 2022-03-25 15:47:05 +01:00
src Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 2022-03-25 15:47:05 +01:00
tests Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 2022-03-25 15:47:05 +01:00
utils Squashed 'lispBM/lispBM/' changes from ffbedbdf..ced143b0 2022-03-01 19:10:34 +01:00
videos Squashed 'lispBM/lispBM/' content from commit 748477b9 2022-01-29 17:26:45 +01:00
zephyr-examples Squashed 'lispBM/lispBM/' changes from 1108de58..0535cf11 2022-02-13 14:25:39 +01:00
.clang_complete Squashed 'lispBM/lispBM/' changes from 6a219e20..7930b985 2022-02-21 12:02:15 +01:00
.gitignore Squashed 'lispBM/lispBM/' content from commit 748477b9 2022-01-29 17:26:45 +01:00
.travis.yml Squashed 'lispBM/lispBM/' content from commit 748477b9 2022-01-29 17:26:45 +01:00
LICENSE Squashed 'lispBM/lispBM/' content from commit 748477b9 2022-01-29 17:26:45 +01:00
Makefile Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 2022-03-25 15:47:05 +01:00
README.md Squashed 'lispBM/lispBM/' changes from 78047efe..6199703d 2022-03-10 16:29:11 +01:00
flash_nrf52_with_stlink.sh Squashed 'lispBM/lispBM/' content from commit 748477b9 2022-01-29 17:26:45 +01:00
lispbm.mk Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 2022-03-25 15:47:05 +01:00
runinfer.sh Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 2022-03-25 15:47:05 +01:00
runsa.sh Squashed 'lispBM/lispBM/' content from commit 748477b9 2022-01-29 17:26:45 +01:00
setup_fw_build.sh Squashed 'lispBM/lispBM/' content from commit 748477b9 2022-01-29 17:26:45 +01:00
zephyr-source-me.sh Squashed 'lispBM/lispBM/' content from commit 748477b9 2022-01-29 17:26:45 +01:00

README.md

lispBM (Lisp Black Magic)

A concurrent lisp-like language with message-passing and pattern-matching implemented in C for 32-bit platforms.

LispBM mascot

All programming languages need a mascot, so here is the LispBM llama by PixiLady.

Purpose

  1. Have fun.
  2. Learn about lisp.
  3. Learn about microcontrollers.
  4. An interactive REPL for devboards.
  5. ...

Features

  1. heap consisting of cons-cells with mark and sweep garbage collection.
  2. Built-in functions: cons, car, cdr, eval, list, +, -, >, <, = and more.
  3. Some special forms: Lambdas, closures, lets (letrecs), define and quote.
  4. 28-Bit signed/unsigned integers and boxed 32-Bit Float, 32-Bit signed/unsigned values.
  5. Arrays (in progress), string is an array.
  6. Compiles for, and runs on linux-x86 (builds 32bit library, runs on 32/64 bit).
  7. Compiles for, and runs on Zynq 7000.
  8. Compiles for, and runs on STM32f4.
  9. Compiles for, and runs on NRF52840.
  10. Compiles for, and runs on ESP32 (ARM - WROOM).
  11. Compiles for, and runs on ESP32C3 (RISC-V).
  12. Compiles for, and runs on Raspberry PI (Tested on 32bit Raspbian OS)
  13. Quasiquotation.
  14. Concurrency.
  15. Message-passing.
  16. Pattern-matching.

Documentation

Want to get involved and help out?

  1. Are you interested in microcontrollers and programming languages?
  2. You find it fun to mess around in C code with close to zero comments?
  3. Then join in the fun. Lots to do, so little time!
  4. Poke me by mail bo(dot)joel(dot)svensson(whirly-a)gmail(dot)com

TODOs

  1. Write some tests that stresses the Garbage collector.
  2. Implement some "reference to X type", for uint32, int32.
  3. Write a small library of useful hofs.
  4. Improve handling of arguments in eval-cps.
  5. Code improvements with simplicity, clarity and readability in mind.
  6. Implement a small dedicated lisp reader/parser to replace MPC. MPC eats way to much memory for small platforms.
  7. Port to STM32f4 - 128K ram platform (will need big changes). (surely there will be some more bugs)
  8. Add STM32f4 example code (repl implementation)
  9. Port to nrf52840_pca10056 - 256k ram platform (same changes as above).
  10. Reduce size of builtins.c and put platform specific built in functions elsewhere. (Builtins.c will be removed an replaced by fundamentals.c)
  11. Implement 'progn' facility.
  12. Remove the "gensym" functionality havent found a use for it so far and it only complicates things.
  13. Add NRF52 example repl to repository
  14. Update all example REPLs after adding quasiquotation
  15. The parser allocates heap memory, but there is no interfacing with the GC there.
  16. The parser uses a lot of stack memory, fix by making tail recursive and accumulating lists onto heap directly.
  17. Rename files with names that may conflict with common stuff (memory.h, memory.c).
  18. It should be possible to reset the runtime system.
  19. Add messages to lisp process mailbox from C to unlock blocked proc.
  20. Spawn closures specifically instead of expressions in general.
  21. Implement some looping structure for speed or just ease of use.

Vague or continuosly ongoing todos

  1. Doxygen?
  2. Tutorials?
  3. Be much more stringent on checking of error conditions etc.
  4. More built in arithmetic.
  5. More built in comparisons.
  6. Make uniform how to return success or failure. It is sometimes bool and sometimes int right now.

Compile for linux (Requires 32bit libraries. May need something like "multilib" on a 64bit linux)

  1. Build the library: make

  2. Build the repl: cd repl-cps and then make

  3. Run the repl: ./repl

Compile on Raspberry Pi

To build the library exeute the following command in the lispbm folder:

PLATFORM=pi make

To build the repl-cps example repl do:

cd repl-cps
make pirepl

Then start it up using ./repl Building the library is not a prerequisite for building the repl anymore.