lispBM: A Lisp for Microcontrollers
LispBM (LBM) is a Lisp or Scheme-like programming language for microcontrollers. LispBM also borrows a couple of ideas from Erlang when it comes to concurrency, message passing, pattern matching and process monitoring. The LispBM runtime system can be compiled for either 32 or 64-bit platforms and runs on a wide range of hardware such as, for example, STM32, NRF52, ESP32 or X86. When running the LispBM runtime system on a microcontroller, it can be built on top of ChibiOS, FreeRTOS or ZephyrOS or, if you are adventurous, on bare-metal. LispBM can also be built to run on top of regular Linux (and now even Windows).
Who wouldn’t want a REPL (read eval print loop) on their embedded platform? This is what LispBM is for!
LispBM Gallery
Contributors
LispBM is made possible by an amazing community of developers who contribute their time, expertise, and passion. You can meet our contributors to see the people behind the project.
There are lots of interesting things to code on in and around the LispBM runtime system. I would love to interact with people who are interested in high-level programming languages on microcontrollers (or elsewhere) so please do not be shy to make contact. Together we can make great stuff happen ;)
Quick Start: Try LispBM on Linux in 60 Seconds
Clone the repository and build the REPL:
git clone https://github.com/svenssonjoel/lispBM.git cd lispBM/repl make ./repl
Note: Requires gcc-multilib, libreadline-dev:i386, and libpng-dev:i386. See the full Linux installation guide for dependency details.
Documentation
- LispBM language reference.
- Graphics library reference.
- TrueType Font (TTF) library reference.
- Runtime system library reference.
- Library of dynamically loadable functionality.
- Gotchas and caveats.
- Implementation C code documents.
- LispBM Language Cheatsheet and to-pdf.sh script that can be used to build a PDF from your modified cheatsheet.
- LispBM Language Cheatsheet (PDF).
- There are video demonstrations on YouTube.
Editor support
Presentations
- Chalmers FP-Talk December 2023 - a video can be found on YouTube
- Chalmers FP-Talk May 2025 presentation
Language Implementation
Texts about language development, implementation techniques, and the technical details behind LispBM.
- LispBM vs Guile 3: Quasiquotation Comparison
- Defunctionalizing a Continuation-Passing Style Evaluator
- Towards a bytecode compiler for lispBM
- Evaluation of expressions using a register machine (Edited June 23, 2020: BugFix!)
- An attempt to get a better grip on the memory usage
- Spawn and Wait: Concurrency in lispBM part 2
- Concurrency in lispBM part 1
- Quasiquotation in lispBM (Edited June 10, 2020: BugFix)
- Boolean operators with short-circuit behavior
- Turning Recursion into Iteration using an Explicit Stack
- Implementation of a lispBM REPL for the ESP32 MCU
- Implementing a lispBM REPL in Zephyr OS
- Compression and parsing of compressed source code
- Garbage collection in lispBM
- Implementing a lispBM REPL in ChibiOs
- Fundamental operations and extensions in lispBM
- Parsing of lispBM expressions
- A quick look at boxed values in lispBM
- More in-depth walkthrough of the lispBM evaluation function
- Introduction to LispBM for microcontrollers
Testing of LispBM
The table below contains test reports for the recent numbered releases of LispBM. The test reports apply to the tagged states with the same numbering on GitHub. The tagged versions of LBM, shown in the table below, have been run through the full test suite and static analysis process. Versions not in this list have not been as rigorously tested. If you want to use LispBM for something serious, please use the most recent tagged version from the table below and keep in mind that testing is never exhaustive and in no way a guarantee of correctness or suitability for any given purpose. A thorough safety and reliability analysis should be performed on the software system where LispBM is integrated as a whole.
We are committed to rigorous testing to make LispBM suitable as a scripting language for any application. These test results provide traceability and document known issues for each version. Improving and developing new testing approaches is an ongoing effort and collaboration is most appreciated.
Please report bugs via the issues tracker on GitHub.
| Testlog | Tagged version | Notes |
|---|---|---|
| 0.34.1 | tag 0.34.1 | Same as 0.34.0 but with bugfixes in the testing framework and tests. |
| 0.34.0 | tag 0.34.0 | |
| 0.33.0 | tag 0.33.0 | |
| 0.32.0 | tag 0.32.0 | |
| 0.31.0 | tag 0.31.0 | |
| 0.30.0 | tag 0.30.0 | |
| 0.29.0 | tag 0.29.0 | |
| 0.28.0 | tag 0.28.0 | |
| 0.27.0 | tag 0.27.0 | |
| 0.26.0 | tag 0.26.0 | |
| 0.25.0 | tag 0.25.0 | |
| 0.24.0 | tag 0.24.0 | |
| 0.23.0 | tag 0.23.0 |
NOTE: The scan-build directory and Infer result file
infer-x.y.z.txt are empty if no issues are found.
We expand on our testing from time to time but currently apply the following testing methods:
- Unit tests.
- Static analysis using CLANG scan-build .
- Static analysis using Infer .
- Static analysis using cppcheck .
- Work in progress - Property based testing using Haskell QuickCheck .
- Test coverage is checked with gcov and gcovr coverage tool.
LispBM Performance Evolution
The performance of the LispBM implementation continuously evolves as we introduce new features and engage in optimization efforts. We work to enhance its efficiency for microcontrollers, such as the STM32F4 running at 168MHz.
Below, you can find performance charts illustrating LispBM’s performance on a set of benchmarks:
If you’re interested in the technical details and benchmarks, you can explore our benchmark code here
Other Lisp-based Languages for Microcontrollers
Explore a range of Lisp-like programming languages that are tailored for microcontroller development. These languages are designed to thrive in resource-constrained environments, making them ideal choices for embedded systems. Whether you’re looking for a lightweight solution or a minimalist Lisp dialect, these languages offer unique approaches to microcontroller programming.
- uLisp: A Lisp dialect specifically designed for microcontrollers. Learn more
- FemtoLisp: A minimalistic Lisp designed for resource-constrained environments. Learn more
- PicoLisp: A lightweight and minimalistic Lisp dialect for both server-side and embedded programming. Learn more
Is your favorite microcontroller Lisp missing from this list? Please send the details in an email to bo(dot)joel(dot)svensson(whirly-a)gmail(dot)com.