September 15, 2004
Lisp Mindstorms

drawing by zoe charlton
Zoë Charlton, Mid America Greetings #1

XS Lisp, by Taiichi Yuasa, is a Lisp programming environment for Lego Mindstorms. Unlike LegoLisp or LegoScheme,which run on a PC and send commands to the RCX computer, XS Lisp runs right on the RCX itself.

XS Lisp includes the following features:

  • read-eval-print loop
  • interactive definition and re-definition of functions
  • appropriate error messages with backtraces
  • function trace and untrace
  • dynamic object allocation and garbage collection
  • robustness against program errors and stack/buffer overflow
  • terminal interrupts
  • truly tail-recursive interpreter
  • event/timer waiting and asynchronous event watchers
  • interface to RIS devices such as motors, sensors, lights, and sounds

Here's some sample code, from Taiichi's ILC 2003 paper:

(define (forward)
  (motor :a (motor :c :forward))
  (play '((:Re4 . 2) (:Do4 . 1) ...)))

(begin
  (speed :a (speed :c :max-speed))
  (forward)
  (with-watcher
    (((touched? 2)
      (motor :a (motor :c :back))
      (sleep 5)
      (motor (if (= (random 2) 0) :a :c)
	     :forward)
      (sleep 5)
      (forward)))
    (wait-until (pressed?))
    (motor :a (motor :c :off))))

Pete Hopkins blogged some notes from Taiichi's ILC talk back in November of last year.

Posted by jjwiseman at September 15, 2004 08:13 AM
Comments
Post a comment
Name:


Email Address:


URL:




Unless you answer this question, your comment will be classified as spam and will not be posted.
(I'll give you a hint: the answer is “lisp”.)

Comments:


Remember info?