Tag: Clojure

Command-Line Intransigence

In the early days of Clojure, I was skeptical of Clojure-specific build tools like Lancet, Leiningen, and Cake. Why would Clojure, a part of the Java ecosystem, need its own build tool when there were already so many Java-based tools? At the time, I thought Maven was the last word in build tooling. Early Leiningen…

Read the full article

Lifecycle Composition

I’ve been thinking about how to build up software systems out of stateful components. In past presentations and blog posts I’ve alluded to a standard interface I use for starting and stopping stateful components: (defprotocol Lifecycle (start [this] “Begins operation of this component.”) (stop [this] “Ceases operation of this component.”)) Most of my Clojure programs…

Read the full article

My Clojure Workflow, Reloaded

I have a new post up on the Relevance blog: My Clojure Workflow, Reloaded. It’s a description of how I work with Clojure interactively using the REPL, tools.namespace, and Leiningen.

Affordance and Concision

Quick, Clojure programmers, what does the following expression do? (get x k) If you answered, It looks up the key k in an associative data structure x and returns its associated value, you’re right, but only partially. What if x is not an associative data structure? In every released version of Clojure up to and…

Read the full article

Clojure 2012 Year in Review

I signed off my Clojure 2011 Year in Review with the words You ain’t seen nothing yet. Coming back for 2012, all I can think of is Wow, what a year! I’m happy to say that Clojure in 2012 exceeded even my wildest dreams. 2012 was the year when Clojure grew up. It lost the…

Read the full article

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…

Read the full article

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…

Read the full article

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…

Read the full article

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…

Read the full article