πŸ”₯ 40 day streak
316 words

Go from zero to clojure in 60 seconds

I’ve shared this before, but I figured I should write something about it again since things have shifted so dramatically in the clojureverse. It used be that leiningen or boot were the go-to tools for clojure development, but they were confusing and often times had a lot more features than what was absolutely necessary. Any clojure developer will tell you that simplicity should come above ease at all costs!! No, I’m kidding, Im not going to extol the virtues of simplification or get into a pedantic argument over what’s easy or simple. Look, let’s just dive right in.

It's easy

The major difference is ease, head to clojure’s getting started page and install clojure for your platform. My platform is and hopefully will always be MacOS, so here’s the big enchilada:

brew install clojure

That’s it! You’re done, you have clojure installed. Congratulations! πŸŽ‰πŸΎπŸŽˆπŸŽŠ

Start it up with clj and you can start typing clojure code into your terminal with no fuss and cuss... ing. Good job! Of course setting it up for repl<->editor integration is a little harder, but that needs to be a screencast anyway. Sit back, relax and pat yourself on the back for a job well done πŸ‘


Now that you have clojure installed let's do one useful thing with it, sum numbers! Super useful! Make a new directory and add two files and a folder like this:

mkdir -p summer summer/src
cd summer
echo '{:paths ["src"] :deps {org.clojure/clojure {:mvn/version "1.9.0"}}}' >> deps.edn
echo '(ns core) (defn -main [] (println (+ 1 2 3)))' >> src/core.clj

Go ahead and run it like this

clj -m core

It should output 6! πŸŽ‰

That's all there is to getting started with clojure now. 2019 might just be the year that clojure takes over the dev world!