uLisp would benefit from a better way of writing and uploading programs. This post discusses some of the possible alternatives, to get feedback and other suggestions.
Currently I think most people use uLisp in one of the following ways:
Write programs directly from a terminal
Pros: No extra software needed.
Cons: No line editing; if you make a mistake you have to enter the function again.
Write programs using the Arduino IDE’s Serial Monitor
The Arduino Serial Monitor is one step up from a terminal. You can type into the input field, and delete to correct mistakes before you click Send. You can also copy and paste functions or even complete uLisp sources into the input field.
Pros: Built into the Arduino IDE.
Cons: No way to store programs, or help with formatting programs.
uLisp Tree Editor
Not sure if anyone uses this. Allows you to edit in-memory functions, but difficult to use; you have to have a mental concept of the function as a tree. See: Using the program editor
SD Card
You can write programs in a text editor and put them on an SD Card, and then read them in. See: Loading uLisp programs from an SD card
Suggested future developments
Line editor built into uLisp
uLisp could be extended with a buffer and line editor to improve its usability from a terminal.
The Lisp Badge has a similar solution. It has a buffer large enough to hold a screenful of text, allowing delete to correct mistakes, and it provides a bracket-highlighting parenthesis matcher to make entering Lisp programs easier.
Pros: Makes using uLisp from a terminal less frustrating.
Cons: Needs RAM for the buffer; a problem on low-memory systems such as the ATmega328P.
uLisp Arduino Core
It might be possible to write a Core (ie plugin) for the Arduino IDE that allows you to:
-
Use the Arduino IDE editor to write and save/load uLisp programs.
-
When you click Upload the entire source would be sent to the attached microcontroller board via the USB port.
-
You could then open the Serial Monitor window and use the uLisp REPL.
Other possible features would be: automatic formatting of Lisp programs.
Does anyone have enough understanding of the Arduino IDE to say whether this would be feasible?
uLisp version of mu editor
The Mu editor is a multi-platform editor designed to act as a simple interface between a computer and Python running on a microcontroller connected via the USB port. It provides an editor pane and a REPL pane. See: About Mu.
It’s open source and configurable via plug-ins; see Mu on GitHub. It might be possible to make a plugin for Mu to enable it to be used as an editor/REPL for uLisp.
Slime
Slime/Swank is an editing environment that that lets you use Emacs with a remote copy of Lisp.
Dave Astels has made a Swank server that lets you use slime-mode in GNU Emacs to interact with uLisp running on a board: see Slime support for uLisp.
There’s also Atom-Slime that would let you interface to uLisp via the Atom editor: Atom-Slime
Pros: An editing environment that understands Lisp and Lisp formatting.
Cons: Requires a copy of Common Lisp running on the host computer. Needs quite a bit of configuration.
I welcome feedback from anyone who has set this up.