30 November 2011

Non-Locking Concurrency Control

At work this week I have been working on implementing a concurrency control strategy on a system. During the discussions, software transactional memory (STM) came up, as we want to develop a solution that does not involve locking, and since my primary experience with it is Clojure's built-in STM, I brought that up.

The world seems to be helping out today with a link on Hacker News to an old discussion involving Clojure's creator Rich Hickey: Clojure: STMs vs Locks. Good food for thought.

It is great to see that my Clojure knowledge is proving to be surprisingly useful at work. Those years of being a closeted functional programming nerd are paying off!

I also re-watched Rich Hickey's talk "Are We There Yet?" and reread "Equal Rights for Functional Objects" by Henry G. Baker, which are both great resources for really thinking about state in a functional manner.

20 November 2011

My Clojure Environment Setup

Mostly for my own personal future reference, here is how I setup my Clojure environment.

  1. Install Emacs 24 (links to the binaries available here).
  2. Install the Emacs Starter Kit or the Emacs Prelude.
Based on instructions from Leiningen (github.com).
  1. Get the Leiningen batch script from https://raw.github.com/technomancy/leiningen/master/bin/lein.bat and edit it to fetch version instead of 2.0.0-SNAPSHOT.
  2. Put lein.bat in a folder. Add that folder to your PATH.
  3. Download wget.exe and curl.exe and add them to your PATH.
  4. Run:
    lein self.install
Setting Up Emacs for Clojure
  1. Setup clojure-mode
  2. Setup swank-clojure
    1. Follow installation instructions from swank-clojure (github.com).