JustinSteward.com

Linux, Python, devops, etc

Recent Adventures - Clojure and Couchdb

19 March 2012

So I've been hacking PHP since early highschool. I was introduced to Java during my University course. I taught myself Python not long after. I even have some rudimentary knowledge of C. But one thing I've never done is tackle a lisp. Or a functional language. So when I set about for a new language to learn, I stumbled on Clojure, and almost instantly fell in love. It's so different from any other language I've worked with before that it's like a breath of fresh air, and requires such a different way to approach problems.

My iniitial observations, after a few months plugging away at it? - The community is fantastic. Genuine requests for help are met with plenty of suggestions on how a particular snippet can be written or rewritten, and this goes doubly so for the Noir project, a micro-framework library, and currently almost the defacto standard. Working with data is something I'm struggling wrap my head aroudn, not having classes or models to neatly wrap up my data interactions is interesting. - I've mainly only toyed with monogdb as a database thus far, and I'm genuinely surprised at how well mongodb's queries can be mapped to clojure code. - Macros. I've not begun to learn how Clojure's macros work, but wow, some impressive voodoo goes on inside these. - Despite being constantly frustrated at the differences between a functional language and my personal experience, I'm genuinely finding clojure a pleasure to write.

I've been using leiningen for managing my projects, and Slimv for editing within vim. Being able to reload individual little parts of an application is an interesting experience, and slimv's implementation of paredit is amazingly useful. I tried out vimclojure at first, but slimv just feels sleeker. My first "real" project is a website for the upcoming wedding for my fiancee and me - not exactly a complex project, but enough to grapple with the basics and learn that I want to learn more.

At some point I might blog about my experiences getting that up and running.

The other project I thought I'd breifly mention is CouchDB. I may just use couchdb as the backend for my next clojure project. Couch is a NoSQL language, with the interesting twist in that your queries are run over HTTP, which lead to the obvious result of someone coming up with a way to host your javascript and other resources within the database, and serving your entire application from your database server. These CouchApps are what drew my attention, but it will possibly be the map/reduce approach to queries that brings me back.

I might post more about couchdb at a later time, but for now, suffice to say that my javascript-foo isn't strong enough to handle a complex couchapp.