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!

New to Lisp? Read about why Lisp is perfect for embedded systems and the story behind LispBM.

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 ;)

For detailed contribution information and to see how you can help, visit our Contributors page.

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.

For detailed getting started guides go here.

Documentation

Editor support

Presentations

Language Implementation

Texts about language development, implementation techniques, and the technical details behind LispBM.

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.

Want to see detailed test coverage? View the latest test coverage report (v0.34.1).
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:

Leading up to version 0.33.0, focus was on improving test coverage. As can be seen from the images below, test coverage has increased significantly and in version 0.33.0 coverage reached 97.4% of functions and 91.7% of lines. There are still improvements needed for branch coverage. Many of the uncovered branches are extremely hard to trigger and in a correctly set-up integration of LispBM it may be impossible to trigger these error conditions. The plan for future testing is to slowly increase coverage with tests designed to trigger even more unlikely edge cases, but overly defensive programming practices (such as conditions that cannot arise in a correctly configured LispBM system) will be removed.
LispBM testing coverage version 0.32.0
Test coverage for version 0.32.0
LispBM testing coverage version 0.33.0
Test coverage for version 0.33.0

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:

LispBM performance benchmarks chart showing execution times
Performance benchmarks with linear scale
LispBM performance benchmarks chart with logarithmic scale
Performance benchmarks with logarithmic scale

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.