Clojure resources


Because much of the work in our group uses the Clojure programming language, I thought it would be useful to post a general list of Clojure resources here, aimed primarily at beginners.

There are many more!

But the intention here is to present a reasonably concise curated list.

Please comment below with suggestions for additions/changes/etc.

Clojure resources

  • Editing and running code: Many Clojure editing and development environments are available. My current recommendation is to use Leiningen from the command line to create and sometimes to run complete projects (with “lein run”), and to use Visual Studio Code with Calva for editing and experimenting with code as you are developing. Two key commands that enable my workflow are Calva: Start a project REPL and connect (a.k.a. Jack-In) and Calva: Send current expression (or selection) to REPL window and evaluate it.

  • When running Clojush programs from command line (and something similar will apply to other GP systems or other long-running Clojure processes), a command like “lein run clojush.problems.demos.simple-regression | tee out” will print the output on the console as well as save it in a file named “out”. The advantage with doing things this way is that you can search for important things in the file using ‘grep’. For example if you want to search for all the lines that starts with ‘Total’, you can use “grep Total out

  • To make Clojush (and other long-running, computationally intensive Clojure programs) run faster, you can use a command like:
    lein with-profiles production trampoline run The output will remain the same.

  • Gorilla REPL: A worksheet environment that can be useful for certain kinds of experiments of even as a full development environment. The Gorilla REPL site has videos that will give you a sense of how it works, and a section called “Secrets,” with content provided by me, that I think will also help to get you going.

  •, the main site for the Clojure language; note especially their Clojure resources page

  • Clojure cheatsheet

  • Clojure style guide

  • Clojure TV

  • Tips for using Clojure on Windows

  • Two blog posts on dealing with Clojure error messages (stack traces): 1 and 2

  • Lee’s tutorial materials:

    • Clojestions, suggested exercises for learning Clojure

    • Clojinc, a saved REPL session intended to support semi-independent learning of Clojure

  • Other tutorial materials:

  • A good free textbook: Clojure for the Brave and True by Daniel Higginbotham. No Starch Press, 2015. ISBN-10: 1593275919, ISBN-13: 978-1593275914. Available free online

  • Lee’s Clojure GP code:

    • Propel, a relatively simple, easy-to-understand but nonetheless fully functional PushGP implementation (a fork of @thelmuth’s project)

    • Clojush, my group’s main research PushGP system, with a zillion features but also a lot of complexity

    • gp, simple Clojure code for traditional, “tree-based” genetic programming (not Push), which is also explained in this talk

  • Clojure MXNet, for the Apache MXNet deep learning framework

  • Simple Clojure neural network code by Hampshire student Julian Oks

  • A few of Lee’s other Clojure projects of possible interest:

    • Rock Paper Stuff, a game designed for artificial intelligence experiments and education

    • Pucks, an environment for experiments and education in artificial intelligence and artificial life

  • Quil, a Clojure/ClojureScript library for creating interactive drawings and animations


Calva has been updated significantly. I’ve updated the post above for the new version, but in case it may be helpful for someone, here is the old text which applies to the legacy version:

  • Visual Studio Code with three extensions enabled: Calva, Calva Clojure Formatter, and Clojure Warrior. Also, in VSCode, select Code > Preferences > Settings (at least that’s where it is in Mac OSX), then type matchBrackets in the search field, and uncheck the Editor: Match Brackets setting. This will keep VSCode’s normal (not Clojure-appropriate) bracket matching behavior from fighting with that of the Clojure extensions.