Discovering Neverland
I was recently introduced to Learn X in Y minutes by a friend. It’s one of those rare gems of the internet. It’s got the best tutorials I've ever come across. They get straight to the point. While scrolling through the languages available, the word clojure caught my eye. *Opens in new tab* and there it was a new lisp.
A lisp made in my lifetime. Wow.
I’ve always wanted to learn a lisp. I just never got round to actually doing it, I suspect it was because I was still too green as a developer. This time was different. So I wrote some random code, played around a bit and tried to implement a neural model in clojure (a real neuron not those imposters from artificial neural networks). The emphasis is on tried.
; Cool clojure code (+ 1 1) ; => 2 (- 2 1) ; => 1 (* 1 2) ; => 2 (/ 2 1) ; => 2 ; Cooler clojure code (+ 1 (- 3 2)) ; = 1 + (3 - 2) => 2
The reliance of clojure on the JVM didn’t sit so well with me though. Whenever I think of the JVM, I think of the Titanic: A huge ship destined to sink. So after a while I just stopped coding. Knowing you’re headed to an iceberg tends to do that to you. Great fun was had nonetheless.Next step, obviously, was to see what people were saying about the language. Off to twitter I went. And almost like magic, one specific tweet jumped out at me.
I went straight to Github to find out more…
And there it was, with no JVM in sight:
Pixie is a small, fast, native lisp with "magical" powers.
So why learn it? 3 reasons: 1. The code is really beautiful. 2. It’s called pixie 3. I’m on holiday
Let’s get started
I tried to follow the instruction on the wiki. That didn’t work out so well for me. After much struggling and the occasional empty Google search result, I resorted to the IRC channel. No-one replied (I’m not entirely sure if I was using it correctly) so I started reading through the logs and I discovered that the was an alpha release build on GitHub (v 0.1). How I didn’t see that the first time will remain a mystery to us both.
1. Download the Pixie binary (v 0.1)
2. Extract the contents and copy them to a sensibly place folder (i.e. not downloads)
3. Create a symbolic link to /usr/bin/pixie-vm
ln -s /pixie-vm /usr/bin/pixie-vm
4. Create an alias for pixie by entering the line below into ~/.bashrc:
alias pixie="/usr/bin/pixie-vm"
5. Then in the terminal enter:
source ~/.bashrc
6. Now enter:
pixie -v
Aces, Charles. You’re aces.
Now for some code
I’ll be honest, I don’t know lisp or clojure so I’m just going to play this by ear using Learn X in Y minutes or anything else I stumble across. The clojure page is a great place to get a feel of the language as pixie’s standard library is heavily inspired by clojure.
Hello World:
(ns one) (print "Hi\n") (loop [x 0] (when (< x 5) (print (str x "\n")) (recur (+ x 1)))) (print "Bye\n")
Something strange
There is something strangely appealing about pixie and lisps in general. Something liberating, kind of like when Forrest Gump’s braces finally come off and he can run and run and run. Let’s see how long this feeling lasts. You know what they say: “Beginning is easy - continuing is hard”
That's all there is, there isn't any more.
(P.S. for now)















