Clojure resources


#1

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. There are two workflows that I use myself, and that I recommend to others unless they have reasons to prefer something else. Both involve using Leiningen from the command line to create and sometimes to run complete projects (with “lein run”), and to start the REPLs that enable interaction from the two enfironments I use and recommend for editing and experimenting with code as you are developing:

    • Gorilla REPL: 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.
    • 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.
  • 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 clojush.problems.software.digits. The output will remain the same.

  • Clojure.org, 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