Live data from Hacker News

uLisp – Lisp for the Arduino

ulisp.com

1–10 of 34 posts

Re: uLisp – Lisp for the Arduino

#2
> It's also an ideal language for expressing complex ideas, such as [...] finding the shortest route on a map

So, I googled "Dijkstra's Algorithm in Lisp" and got this: http://richardsherriff.com/?p=233

Now, I'm no lisp expert, so I can't judge whether the author of this code actually knows what they're doing, but I know for sure that in an imperative language the implementation of the algorithm is much more concise and understandable.

I have concluded from my observations that claims of Lisp being "easier", "ideal for learning fundamental programming concepts" and "more expressive" are exaggerated.

Re: uLisp – Lisp for the Arduino

#4

> It's also an ideal language for expressing complex ideas, such as [...] finding the shortest route on a map So, I googled "Dijkstra's Algorithm in Lisp" and got this: http://richardsherriff.com/?p=233 Now, I'm no lisp expert, so I can't judge whether the author of this code actually knows what they're doing, but I know for sure that in an imperative language the implementation of the algorithm is much more concise…

Congratulations, you have found the most ugly Lisp code ever.

> so I can't judge whether the author of this code actually knows what they're doing

Not really. He can't even format the code.

For example from that blog post:

    (defun return_highers_helper (list element result)

    (cond

    ((null list) result)

    ((equalp (first element) (first (first list)))

    (cond

    ((
This would be written usually as:

    (defun %return-highers (element list)
      (remove-if-not (lambda (item)
                       (and (equalp (car element) (car item))
                            (

Re: uLisp – Lisp for the Arduino

#5

The AVR cpu at the core of the Arduino uses a (modified) Harvard architecture., which separates code from data memory. A key feature of lisp of that code IS data. How does uLisp bridge the contradiction?

It provides a Lisp interpreter written in C.

You can read the implementation... code:

http://www.ulisp.com/list?1BWZ

Re: uLisp – Lisp for the Arduino

#7
uLisp includes a mark and sweep garbage collector. Garbage collection takes under 1 msec on an Arduino Uno or under 3 msec on an Arduino Mega 2560.

I wonder how predictable and controllable that is. Adding GC to what is likely to be a real-time device seems like a potential showstopper. But if the numbers can be a bit more firm, or if the application can receive alerts on pause / resume, that might not be such a big deal.

Re: uLisp – Lisp for the Arduino

#10
post #7

uLisp includes a mark and sweep garbage collector. Garbage collection takes under 1 msec on an Arduino Uno or under 3 msec on an Arduino Mega 2560. I wonder how predictable and controllable that is. Adding GC to what is likely to be a real-time device seems like a potential showstopper. But if the numbers can be a bit more firm, or if the application can receive alerts on pause / resume, that might not be such a big…

As I said in another thread recently, garbage collectors don't have to be of the stop-the-world, non-deterministic kind. It's perfectly possible to have real-time garbage collection [1], and the language I commonly work with supports soft real-time use with the default GC [2]. I'm no expert on garbage collection techniques, but what I have picked up is that most of the challenge lies in timing of the collections (when to run the GC) and how to deal with things like cycles.

[1] http://michaelrbernste.in/2013/06/03/real-time-garbage-colle...

[2] http://nim-lang.org/docs/gc.html

Post reply on HN