Use Scheme functional programming language with LambdaChip Alonzo STM32 board

Most MCU-based embedded systems come with firmware programmed with assembler, C, and/or C++.  But as referenced in a paper published in 2000 entitled ” Point of view: Lisp as an alternative to Java“, functional programming languages like Lisp or Scheme may lead to shorter development times compared to C/C++ or Java.

Java vs C vs Scheme development time

That’s with this idea in mind that LambdaChip was created. It is a lightweight, open-source virtual machine designed to run on embedded systems with limited resources, for instance, an 80MHz microcontroller with 50KB RAM, and programmable with Scheme multi-paradigm programming language, a dialect of Lisp widely used for functional programming research and teaching.

The company behind the project, also called LambdaChip, has just created its own hardware with LambdaChip Alonzo, an STM32 Cortex-M4 development board with 512KB flash, 128KB RAM, and that also comes with Bluetooth LE connectivity.

LambdaChip Alonzo STM32 Scheme functional programmingLambdaChip Alonzo board specifications:

  • MCU – STMicro STM32F411CEU6 Arm Cortex-M4 MCU @ 100 MHz with 512KB flash, 128KB RAM; UFQFN48 package
  • Storage – MicroSD card socket
  • Connectivity – Bluetooth 4.0 Low Energy
  • Expansion – 2.54mm pitch header for GPIOs
  • Debugging – 10-pin programming header for an external debugger
  • Misc – RGB LED, white LED, 3x buttons (BOOT0, RST, and User)
  • Power Supply – 5V via USB-C port, or battery via 2-pin connector

The board is not really unique, but includes the features need for LambdaChip such as a microSD card where the resulting binary is copied after compilation and automatically loaded by the virtual machine.

LambdaChip Alonzo Debugger Kit

You’ll need a debugger to program the board, and that’s why the company also provides a complete kit with the Saruman debugger, USB and debugger cables, microSD card, USB SD card reader, and an acrylic case.

A Linux-based operating system is recommended for development, but since as they provide a docker image, Windows and Mac OS are also supported. Everything is done from the command line through the Laco environment with a Scheme compiler generating a LEF bytecode file. That is what a blinky sample looks like in Scheme:

You can download the schematics (PDF only), and read the documentation on LambdaChip website. The BLE demo below shows how to use the Laco environment to program the board, and transmits some messages to an Android phone running LightBlue app.

LambdaChip Alonzon board can be purchased for $29.00, but most people interested in the project would probably prefer to purchase the full kit for $99.00. Both are available on Seeed Studio.

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX RK3588 mini-ITX motherboard

7 Replies to “Use Scheme functional programming language with LambdaChip Alonzo STM32 board”

  1. May not be as polished/all-inclusive as the LambdaChip stuff, but if you have some MCU boards laying around, uLisp is very cool and very useful: – broad CPU support, extensible via normal Arduino IDE methods, etc.

  2. If we’re going with interpreted languages, why not Python instead?

    Would be interested to see if has anyone done a Lisp vs. Python resource usage comparison.

  3. LambdaChip seems the only optimized compiler in MCU world. All others are interpreters, say, micropython, elua, ulisp, etc.
    The trade-off is to drop REPL to control hardware, but the bytecode can be optimized for both size and performance.
    Besides, LambdaChip is based on ZephyrRTOS, so it means it never concerns to support various platform, it can run on any platform supported by ZephyrRTOS, and that list is so long…

  4. No thanks, I don’t like Lots of Irritating Single Parentheses.

    LISP is normally interpreted, and it looks like the Lambda chip compiles to byte code for a virtual machine.

    One question: how does this integrate with C? Python, Lua, Rust, C++, and such all integrate well with C, making it easy to interface with existing C code.

      1. BTW, pick a better modern editor, and a parens plugin. Today the parens are handled well by the plugin, no irritation. It’s 21st century.

Leave a Reply

Your email address will not be published. Required fields are marked *

Khadas VIM4 SBC
Khadas VIM4 SBC