Tags

Share it

“If everything seems under control, you’re not going fast enough.” — Mario Andretti.
Programming is hard. — Joe Armstrong

What follows is not meant to be negative about Clojure but getting stuck sucks, so just today I feel like complaining a little bit. I guess I’ve caught a bad case of the learning curves.

Since a few weeks I’ve been skilling Clojure and ClojureScript. Especially the promise premise of ClojureScript as a powerful front-end language seems like Nirvana. Not to mention the goodness one can get in combination with React. I am going to like UI programming again!

It was the middle of January, 2015 and I decided to finally have a serious look at Clojure. To quickly get a good grasp on it, it seemed worthwhile to backtrack a little and understand it’s Lisp DNA. And so I experimented some with Joxa (since I love EVM/BEAM), PicoLisp (it rocks!), Chicken Scheme (funny name, but it translates to C!) and Racket (quickest way to start with Scheme but a very strange UI). I used Emacs, Vim, Light Table and ran back again to Sublime Text. Evenings were spent reading bedtime stories from On Lisp and SICP until in the end my whole brain was homoiconicized. Yes, I should have written my own Lisp compiler in Lisp in college but I didn’t and yes I regret that. (Let’s see how long it takes until I implement my first DSL).

Firmly back in Clojure land I started reading just about every blog from the past 7 years. I starred a bunch of stuff on Github, read The Joy of Closure and did some backflips in the REPL. Good times.

The honeymoon lasted a whole two weeks until I started to try some different things (some actual things). Of course problems are expected and a part of learning, so no worries! I first ran into a bit of trouble with Leiningen, the de facto tool of choice on the Clojure/script planet. Then I read somewhere that Boot might be easier to integrate with a Phonegap project since Boot doesn’t litter aardvarks all through your directories. Perfect. I soon got a working REPL into my iOS simulator and managed to do a js/alert in my Om app! I was beating my chest as I was no longer a Clojure noOb. There was nothing left in my way to having a ClojureScript+Om+React Phonegap app in the App Store. All that was remaining was just blissful productivity, paradise by the LED backlight.

Then, on a separate project, for some reason I couldn’t get the browser REPL to work anymore. After detours learning about Maven, .m2 repository, Clojure dependency hell and finding that the REPL API had changed, some of the things I wanted to do had to wait for certain libraries to catch up. I wondered, hm… is this stuff stable? The fact that Clojure depends on the JVM didn’t help either. Long startup times and useless stack traces were getting old quickly. Fortunately my dependencies got fixed and soon I was on my way making progress go forwards again.

Until– I wanted to do things differently. Instead of Jetty, I wanted to try Aleph. But since almost the entire tool chain depends on either Jetty or Http-kit, it meant digging into Boot Tasks, and subsequently reading and understanding a lot of Boot’s guts. Then I found immutant2. Someone fortunately had already done all the work and I could just fork that and make a Boot task for Aleph! I love open source!

So now I have github/23min/immutant2 which I plan to name boot-aleph with some simple Aleph changes and it should fix my problems. Except… Clojure doesn’t like it:

user=> (require '[23min.immutant2 :refer :all])
NumberFormatException Invalid number: 23min.immutant2 clojure.lang.LispReader.readNumber (LispReader.java:253)
RuntimeException Unmatched delimiter: ] clojure.lang.Util.runtimeException (Util.java:170)
RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:170)

Say what!? The Clojure Reader trips over my Github id! And apparently it’s not a bug: Symbols begin with a non-numeric character. I think this means I am S.O.L.!

At this point I give up. I’m really persistent normally, but at the end of my latin, when disillusionment knocks I just open the door. I mean, seriously, how much can a man take?

(If anyone knows of a workaround, please let me know.)