A better IDE for uLisp?


#21

Actually, if we have ulisp mode, we can use dedicated python libraries for MicroPython - CircuitPython, interfacing them and flashing devices - uploading our code to MCU’s. But save-image and load-image already do that in some extent.

It will make sense if ulisp compiles for MCU’s. Until then, I’m not sure is it worth to do that.


#22

I’ve just be trying out uLisp for a couple of days and figuring out a nice way to interact with it on my Maxiduino. In the end I settled on what I’ve done for Lisp in the past, namely Emacs with lisp-mode and inferior-lisp. Below is an outline of how to dup what I have:

For interacting with uLisp in a terminal window ‘cu’ is in the repos,
run the command in a terminal (adjusting the dev and speed if needed):

cu -l /dev/ttyUSB0 -s 9600

For emacs interaction add the following 2 lines to the ~/.emacs file:

(setq inferior-lisp-program "cu -l /dev/ttyUSB0 -s 9600")
(setq comint-process-echoes t))

In Emacs start an inferior Lisp buffer with the command:

meta-x inferior-lisp

The inferior-lisp has basic Lisp support (paren matching), and return
sends the sexpr to uLisp and prints the result in the window.

To edit uLisp files use lisp-mode by finding a file with a .lisp
extension. This will have Lisp editing support such as paren
matching, syntax highlighting, etc.

In lisp mode you can send regions or sexprs to uLisp with:

meta-x lisp-eval-region
control-x control-e

The later sends the sexpr before the cursor to the inferior Lisp.
There is a lot of other support, but those are the basics.

For editing large uLisp programs you can use tag tables, for example
to browse the assembler, assuming it is called assembler.lisp:

etags assembler.lisp

Then in Emacs edit the assembler.lisp file and use the command:

 meta-.

After loading the TAGS this will jump to the definition under the
cursor or the definition you enter.

Once you have this setup there is more support you can explore, but I think that is most of what you need.


#23

Forgot to mention 2 things in my last note:

  1. I increased the RingBuffer as described in the uLisp docs , but set it to 4k. This is enough to eval the entire assembler; and

  2. If you are running the ‘cu’ command in a terminal, you can’t also run it in an Emacs buffer, there is only one user of the device.