Is there a sales pitch for switching to deps.edn from Lein in 2020?

Beyond what @seancorfield said. I want to add that it’s not apples to oranges comparing Lein and Clj.

The new Clj tool does two things:

  1. Download appropriate dependencies.
  2. Bootstraps a Clojure program with appropriate classpath and main args and what not.

Lein does all the above, but it also:

  • Lets you perform a number of common build tasks

Clj doesn’t come with any build tasks. The best it can do is create a pom.xml which allows you to use maven for certain build related tasks. But on its own, it means that it can’t:

  • compile your project
  • put it into a jar
  • or an uberjar
  • it can’t run your tests
  • lint your code
  • clean your compilation target folder
  • deploy your library to a remote maven repo
  • compile java code
  • scaffold new Clojure projects
  • search Maven for libraries
  • etc.

The only thing Clj can do is download a Clojure program to your machine with all its required dependencies and run it. Or download all of your project’s dependencies and run it.

So if you want to do anything “build” like, you need to use something else over Clj.

But, because Clj can download and run Clojure programs. It is easy to use it to download other Clojure programs that were designed to perform “build” like tasks and run them.

You can also have it create a pom.xml like I said, and then make use of Maven for certain build tasks. Maven will be good for Java related tasks, and creating Jars, publishing to Mavn repos, etc. Not so much for Clojure specific tasks.

Finally, when you think of Clojure, the truth is, there is very little “building” required. Since Clj can download and run Clojure programs that are available as source on github, you can go very far with just git and clj.

4 Likes