
uLisp: Lisp for microcontrollers - tosh
http://www.ulisp.com/show?3J
======
rwmj
I'm impressed that they seem to have managed to get a mark-sweep GC to work
with only 2K of RAM. Or does it use a special non-GC mode with small amounts
of RAM?

~~~
pjc50
They've used the classic technique of the bottom bit of the car pointer. The
code is easy enough to read:
[https://github.com/technoblogy/ulisp/blob/master/ulisp.ino](https://github.com/technoblogy/ulisp/blob/master/ulisp.ino)

    
    
        #define mark(x)            (car(x) = (object *)(((uintptr_t)(car(x))) | MARKBIT))
        #define unmark(x)          (car(x) = (object  *)(((uintptr_t)(car(x))) & ~MARKBIT))
        #define marked(x)          ((((uintptr_t)(car(x))) & MARKBIT) != 0)
        #define MARKBIT 1

~~~
rwmj
Marking isn't the problem. It's fitting a minor + major heap into 2K. In my
(small, but not very optimized) ML implementation a useful minor heap is
probably min 64K.

------
Iwan-Zotow
If you have some space to spare, consider femtolisp:
[https://github.com/JeffBezanson/femtolisp](https://github.com/JeffBezanson/femtolisp)

~~~
eggy
What does femtolisp have compared to ulisp?

Also there is this board, Lisp Badge that runs ulisp and has a keyboard and
screen on the pcb board!

[http://www.technoblogy.com/show?2AEE](http://www.technoblogy.com/show?2AEE)

------
nanomonkey
I'm curious how uLisp compares to esp-lisp ([https://github.com/yesco/esp-
lisp](https://github.com/yesco/esp-lisp)) on the esp32, which appears to be
the most performant of the microcontrollers listed.

------
jackhack
Related: A Common LISP for embedded systems. Prof. Rod Brooks (MIT)
[https://www.researchgate.net/publication/2949173_L_--
_A_Comm...](https://www.researchgate.net/publication/2949173_L_--
_A_Common_Lisp_for_Embedded_Systems)

developed for building robots using the Moto68332 with 32K of memory, but will
work down to about 10K.

------
bibyte
I have always wanted something like this. I can't really build this myself
because I have no hardware skills.

~~~
russh
If you have the desire, there has never been a better time to learn!

------
microspino
Enjoyed the introduction to uLisp a lot. The author is also a very good
teacher and writer.

------
dang
From 2016:
[https://news.ycombinator.com/item?id=11777662](https://news.ycombinator.com/item?id=11777662)

------
tomcam
Requires a princely 32K, or less than their logo.

~~~
bitwize
Drat, and here I was hoping to get it running on an unexpanded 16K Speccy...

~~~
yarrel
There's always [http://blog.funcall.org/lisp/2015/10/30/zx-spectrum-
lisp/](http://blog.funcall.org/lisp/2015/10/30/zx-spectrum-lisp/)

