dragoncoder047 / ulisp-esp32

A modified version of uLisp for ESP32-based boards. Many new/experimental advanced features including defmacro, backquote, gensym, destructuring-bind, and catch/throw. Also includes an enhanced REPL program
MIT License
1 stars 0 forks source link
arduino arduino-esp32 embedded lisp lisp-dialect lisp-interpreter microcontroller repl

ulisp-esp32

A (patched) version of the Lisp programming language for ESP32-based boards. Heavily customized to fit my use case but most of the original remains. For more about the original ulisp-esp see http://www.ulisp.com/show?3M#esp-version

This is based off of uLisp 4.6. For the old patches (some of which don't work) for uLisp 4.3a please see the 4.3a-old branch.

[!NOTE] This version includes (requires?) the ESP32Servo library to get the analogWrite() and tone() functioning correctly. If you don't have it installed uLisp will compile but you won't have analogWrite() and tone().

New features, some care in editing required:

Copy-paste ready features (all in extensions.hpp):

Also included is David's bigint library and the example (now) function.

Other patches:

[!CAUTION] If you are looking to use this patched version as a guide for adding any of the 3 starred (*) features listed above, please use this guide I prepared instead. There are many subtle changes in my patched version that are understandable to me, but will no doubt cause confusion for someone who is just copy-pasting my code. The aforementioned document is structured and designed to allow copy-pasting into vanilla uLisp without major problems arising.

term.py -- enhanced uLisp interface

This provides a cleaner interface to use uLisp in compared to the stupid Arduino serial monitor.

Dependencies:

To run:

# use default port and baud (/dev/ttyUSB0 and 115200)
python3 term.py
# specify port and baud
python3 term.py -p COM3 -b 9600

UI Overview:

----------------------------------------------------
|                    ^|                           ^|
|                     |                            |
|       LISP          |       SERIAL               |
|       BUFFER        |       MONITOR              |
|                     |                            |
|                     |                            |
|                    v|                           v|
|--------------------------------------------------|
|cmd>  COMMAND AREA                                |
|--------------------------------------------------|
| STATUS BAR                          RIGHT STATUS |
| MEMORY USAGE                        LAST GC INFO |
----------------------------------------------------