Stuart Hinson bio photo

Stuart Hinson

Ruby, Rust & Clojure programmer.

stuarthinson<at>gmail

LinkedIn Github

Pixie is a Clojure-inspired lisp that has a quick startup time and nice FFI support that allows it to make use of existing C libraries, making it a nice option for working with the Raspberry Pi.

Installing Pixie

Meeting Dependencies

From a base Raspbian install, Pixie’s dependencies (as of eb5886ff95) except for libuv-dev can be satisfied using aptitude

sudo apt-get install libffi-dev libedit-dev libboost-all-dev

libuv-dev (and libuv) are available from the Jesse packages. Use the armhf builds.

Use wget to grab the packages and install with

sudo dpkg -i libuv*armhf.deb

Building the Pixie VM

make build_no_jit

It’ll run for about an hour. Enjoy the excellent ascii art the RPython build process produces.

Cross compilation from a faster machine may be an option as well.

Interfacing with the Raspberry Pi’s GPIO

Using Pixie’s FFI, I made a library called wiringPixie wrapping wiringPi. Follow the instructions on the README to install

https://github.com/stuarth/wiringPixie

and start hacking (or controlling LEDs :))

(require wiring-pixie.gpio :refer :all)

(def pin 7)

(wiringPiSetup)         ;; required first!
(pinMode pin OUTPUT)    ;; pin to OUTPUT
(digitalWrite pin HIGH) ;; set pin 7 to HIGH