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. 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.

Testlog Tagged version
0.34.1 tag 0.34.1
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 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:

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 drastically and we are now covering 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.