Live data from Hacker News

uLisp – Lisp for the Arduino

ulisp.com

31–34 of 34 posts

Re: uLisp – Lisp for the Arduino

#31
post #28
post #22

Earlier quoted context omitted.

I have TinyScheme running on a STM32F415. https://sc4.us/hsm/

Any BSD kernel drivers for this?

It's just a USB serial device, so if BSD supports those (and I can't imagine that it doesn't) then it will work. But I don't run BSD so I haven't tried it.

Re: uLisp – Lisp for the Arduino

#32
post #23
post #22

Earlier quoted context omitted.

I have TinyScheme running on a STM32F415. https://sc4.us/hsm/

I love TinyScheme. I love NaCl. This is wonderful!

Thanks. I have a few left from a limited production run that I'm selling for $55. Send me an email if you want one. I'm also going to be doing a kickstarter to raise money for a real production run.

Re: uLisp – Lisp for the Arduino

#33

Though uLisp has tail-call optimization, if the C compiler doesn't, then the garbage collector needs stack in proportion to list length: void markobject (object *obj) { if (obj == NULL) return; object* arg = car(obj); if (marked(obj)) return; int type = obj->type; mark(obj); if (type != SYMBOL && type != NUMBER) { // cons markobject(arg); markobject(cdr(obj)); // It's simple enough to obj = cdr(obj) and wrap a loop a…

Good suggestion!

Re: uLisp – Lisp for the Arduino

#34

Though uLisp has tail-call optimization, if the C compiler doesn't, then the garbage collector needs stack in proportion to list length: void markobject (object *obj) { if (obj == NULL) return; object* arg = car(obj); if (marked(obj)) return; int type = obj->type; mark(obj); if (type != SYMBOL && type != NUMBER) { // cons markobject(arg); markobject(cdr(obj)); // It's simple enough to obj = cdr(obj) and wrap a loop a…

By the way, you can't eliminate the need for a stack when traversing the cell graph (unless you give them parent pointers, thereby hiding the stack in the data).

That's why I wrote "in proportion to list length", not "tree structure depth" in general.

Above, we still have recursion when marking the arg = car(obj) value. However, Lisp lists tend to be greatly unbalanced in favor of growing in the cdr direction; that is why it helps to iterate on the cdr.

Post reply on HN