When (Not) to Write a Macro

The Solution in Search of a Problem A few months ago I wrote an article called Syntactic Pipelines, about a style of programming (in Clojure) in which each function takes and returns a map with similar structure: (defn subprocess-one [data] (let [{:keys [alpha beta]} data] (-> data (assoc :epsilon (compute-epsilon alpha)) (update-in [:gamma] merge (compute-gamma… Continue reading When (Not) to Write a Macro

Why I’m Using ClojureScript

Elise Huard wrote about why she’s not using ClojureScript. To quote her essential point, “The browser doesn’t speak clojure, it speaks javascript.” This is true. But the CPU doesn’t speak Clojure either, or JavaScript. This argument against ClojureScript is similar to arguments made against any high-level language which compiles down to a lower-level representation. Once… Continue reading Why I’m Using ClojureScript

Syntactic Pipelines

Lately I’ve been thinking about Clojure programs written in this “threaded” or “pipelined” style: (defn large-process [input] (-> input subprocess-one subprocess-two subprocess-three)) If you saw my talk at Clojure/West (video forthcoming) this should look familiar. The value being “threaded” by the -> macro from one subprocess- function to the next is usually a map, and… Continue reading Syntactic Pipelines

Three Kinds of Error

Warning! This post contains strong, New York City-inflected language. If you are discomfited or offended by such language, do not read further … further … further … further … This is about three categories of software error. I have given them catchy names for purposes of illustration. The three kinds of error are the Fuck-Up,… Continue reading Three Kinds of Error

Clojure 2011 Year in Review

A new year is upon us. Before the world ends, let’s take a look back at what 2011 meant for everybody’s favorite programming language: Clojure 1.3.0 was released, bringing better performance to numeric applications, reader syntax for record types, and other enhancements. ClojureScript was unveiled to the world, leading to universal confusion about how to… Continue reading Clojure 2011 Year in Review