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.
Note that only versions X.Y.0 get a tag and a full run of all tests.
Versions X.Y.Z for non-zero Z are experimental and in development,
and are sporadically tested as part of development but not given a full testing log treatment.
If you want to use LispBM for something serious, please use an X.Y.0 version
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.
The table of test-results is provided for traceability purposes and gives a snapshot of known problems with a given version of LispBM.
That said, we are very serious about our testing and we do want to make it possible to use LispBM as a scripting language integrated into any application. This is an ongoing effort and collaboration is most appreciated.
Please report bugs via the issues tracker on GitHub.
NOTE: The scan-build directory is empty if the scan-build tool finds no issues with the code.
NOTE: The Infer result file infer-x.y.z.txt is empty if Infer finds no issues.
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.