Clojure dev setup links

Collected dev setup tips from my first week of playing with Clojure.

Getting started

Download the Clojure CLI (invoked as clj on OSX). Here’s the starter guide on dependencies and running scripts using the CLI.

Build tooling

Leiningen, invoked as lein, is a commonly used Clojure project manager that helps you manage dependencies, run tests, package your project, etc.

Workflow tips

When in doubt, pair!

After I complained about my confusion in the relevant RC chat channels, a kind soul offered to show me recommendations for an ergonomic Clojure workflow and point out some common beginner mistakes, almost all of which I was making. Thank you!! I wish I had gotten this walkthrough three days ago, but also am thankful that I got this walkthrough so soon into my functional programming journey.

Recommendations

The aforementioned kind soul sent me a bunch of useful recommendations to improve my workflow:

vim + Clojure/Script workflow

Hot-loading ClojureScript

Debugging frustrations

Very little of the open source Clojure I’ve been checking out contains comments for some reason. While I get my footing, I’ve been finding clojure.core/pr-str useful to sanity check what’s happening inside my lazy sequences: (println (pr-str x))

I’m used to verbose error handlers, and Clojure error stacks are rather arcane. This is additionally frustrating when I clone a 3rd-party library and I don’t know how to debug the examples without reading the entire library. There must be some way to debug the horrific error stacks coming out of functional that I just haven’t found yet.

notes on debugging Clojure - Eli Bendersky

Lazy sequences

Type errors involving lazy sequences seem to surface often in Clojure error stacks.