A previous Adafruit Guide talks about using FORTH and LISP on SAMD51 based boards. The performance and memory provide the opportunity to get away from assembly language and C/C++ and use different styles of language. CircuitPython is a perfect example of this. But it does not have to stop there.
A problem is the language implementations ran on the bare metal (the hardware), losing many of the advantages that a higher-level language like CircuitPython can provide. Maybe the most important of these is the ability to treat part of the board's flash storage as a USB drive and place source code there simply by editing files directly on the drive or copying them to it (including dragging and dropping).
This guide introduces an implementation of a Lisp dialect very similar to Scheme with an interesting feature: it's written in Python 3. It's called is CircuitScheme. The implementation is based on Lispy.py written some time ago by Peter Norvig who wrote the books Artificial Intelligence: A Modern Approach and Paradigms of AI Programming: Case Studies in Common Lisp . He is currently Director of Research at Google. TL;DR he knows his stuff.
Norvig authored two articles that describe the background and implementation of Lispy:
These provide a description of Lispy and a good introduction to the techniques and considerations of implementing another programming language in Python. This guide will not replicate the content of those papers. You may read them, then come back and see how we can use this in CircuitPython.
Python is a a good language for implementing Lisp as it already has a lot of the capabilities that are needed. Being able to leverage Python's garbage collection is especially useful. Lispy goes even further than some implementations in that lists are implemented directly by Python lists.
So we have a Lisp to program in with all the advantages of the CircuitPython infrastructure. It also means that it's easy to add functionality such as support for hardware interaction. We'll cover that later in the guide.
The goal of this guide isn't to teach you Scheme; there are various resources online for that. https://schemers.org/ is a good central spot to find them. An excellent resource for learning Scheme is The Structure and Interpretation of Computer Programs which is a text that was used for first year computer science at MIT for many years. It was co-written by one of the creators of Scheme (and MIT professor), Gerald Sussman. MIT recorded the series of lectures from the course and has made them available, along with electronic versions of the book. In this guide, you will learn Scheme as a side effect of using it as the language used to explore concepts in computing.
Lispy will run comfortably on any M4 Express board: Grand Central, Feather, or ItsyBitsy. Do not forget to also get a good USB cable to connect the board to your computer.