Calva

tl;dr Calva seems like a pretty kick-ass Clojure development environment.

Most of my Clojure development these days is done in the excellent Cursive plugin for IDEA. That said, I’m hardly editor monogamous. While I do the bulk of my non-Clojure programming with Vim in a terminal1, I’ve started doing a lot of JavaScript and TypeScript development in Microsoft’s VS Code. I’ve been hearing a lot about Calva lately, which is a plugin for Code that provides a Clojure development environment. I’m always curious about new Clojure tooling, so I figured I’d kick the tires.

I haven’t had a lot of time to dig in, but I’m already plenty impressed. It is super duper easy to get going. You start with a bare-bones deps.edn in a directory:

deps.edn

{:aliases
   {:nrepl
    {:extra-deps {nrepl/nrepl {:mvn/version "0.6.0"}}}}}

And then open the directory as a workspace in Code. Then run the “Calva: Start a Project REPL and Connect (aka Jack-in)” via the command palette, or just use the keyboard shortcut Ctrl-Alt-C, J. You’ll next be presented with a list of project types. For this deps.edn-based project, you’ll want to pick the “Clojure CLI” option. Calva parses the deps.edn and displays checkboxes for the aliases to include in the command. Pretty darn slick! For this demo, check the :nrepl alias and proceed. Calva downloads the dependencies, including some CIDER middleware, and automatically sets up Code for some a decent REPL-based development flow.

In my short time playing with it, I’ve been really impressed by the level of polish. Here are some of the things I dug:

This was a whirlwind tour that’s only scratching the surface of what Calva offers. It was a strong enough first impression that I’m definitely planning on trying it out with a larger project. In particular, it seems to have a good ClojureScript story2, so I’m excited to dig deeper there.

Questions? Comments? Contact me!

  1. It’s what I’m using to type up this blog entry. Return
  2. I believe the Calva authors actually develop the plugin with shadow-cljs. Return

Tools Used

Calva
2.0.72
Clojure
1.10.1
Visual Studio Code
1.41.0