Welcome! Please see the About page for a little more info on how this works.

+2 votes
in Tools by
edited by

The official Getting Started guide shows how to install Clojure and its dependencies for macOS, Linux, and Windows, using command-line tools.

Those procedures work well for experienced programmers who are comfortable figuring things out. However, when it comes to lowering the barrier to entry for beginners, this is less than ideal and leads to a poor first impression.

I use the guide mentioned above in my "Getting Started with Clojure" workshops, geared towards beginners with little to no prior experience with Clojure or programming in general. And I see first-hand how people struggle to get Clojure installed and working correctly on their system, especially Windows users.

Allowing users to install Clojure and all dependencies in a single step would make it easier for people to install Clojure and dramatically improve the user experience for newbies, which is essential for increased exposure and adoption.

To that end, I want to propose official "download and double-click installers" for all operating systems. For inspiration, check out the installers offered by other languages like Python or Go. "Just download this installer and run it. That's it."

Also, Scala has an excellent landing page with two options to guide beginners and advanced users to different installation guides. Beginners are encouraged to try Scala in the browser without installing anything on their computer. For Clojure, we could guide beginners to something like Calva or Maria.

In summary: We could draw inspiration from other programming language ecosystems to create a smoother installation experience for beginners. After discovery, the newbie experience begins with the installation process.

Note that there is a relevant discussion ongoing in the Clojurians Slack.

4 Answers

+3 votes

One attempt at making things easier is the deps.clj project which offers a drop-in replacement for the official Clojure tools. See https://github.com/borkdude/deps.clj. It offers a standalone binary, uberjar and babashka script which all do the same thing. I’ve heard especially from Windows users that it was easy for them to install it.

Thanks for deps.clj, @borkdude! Since we bundled it with Calva we've been able to help a lot of Windows users to try Clojure in the editor, and build up some excitement before they take on the task of installing clojure.
+1 vote

I don't think there is a path to a one-click binary installer for Clojure. Java is needed, and it will vary a lot between machines and OSs how that installation should be performed. A dev container maybe, but it moves the problem to also having Docker installed.

At a workshop like yours, Leif Eric, and probably outside that context as well, I think one way to make it a one-binary-install is to use babashka. We can probably make some starter project where either JVM Clojure or babashka can be used. This way people can have an easy way to install what's needed to try the language out for something productive and a nice path forward, making the efforts of installing Java more worthwhile.

Thanks for the suggestion, Peter! I have a (probably naive) follow-up question about the JVM: Why is it difficult to make a binary installer that installs some JVM version along with Clojure? I thought the JVM was super ubiquitous, portable, and embeddable. Again, pardon my ignorance, as I have minimal prior experience with Java and the JVM.
As PEZ mentioned babashka, bb clojure <args> is the same as deps <args>, as babashka already uses deps.clj. So there is no need to install deps.clj separately if you already have bb.
0 votes

Hello friends, I'm a developer using only windows for my dev env. Notice that I've also got a linux dual boot and WSL2 installed but I prefer using windows with cmd.exe. I'm using Windows to develop python elixir and java. One thing to consider is the fact that clojure requires powershell to be installed and seems to not offer any alternative.

I'd really recommend to offer a solution for installing clojure for people that don't use powershell; most developers I know using windows do not use powershell but use the good ol' cmd.exe. Powershell is mainly used by Windows Administrators; it doesn't offer anything of value to developers and all the other environments I'm using do not require powershell.

The solution proposed in the original question; "Just download this installer and run it. That's it." would be ideal. Install an executable in the path and use that. Also, you may want to consider talking about lein; lein works fine for windows without any powershell requirement so it can be considered a solution for people that don't want to use powershell..

IMHO, "Getting Started/Other ways to run Clojure" should mention Leiningen as alternative, because it is "the other way to run Clojure" ;) Also, I find Leiningen has still has better user interface, especially for novice users.

Installing and starting repl:

## Leiningen

1. Get "lein" script.
2. Run: lein repl.
3. Connect your favorite editor.

## Clojure Tools

1. Get installer.
2. Run it.
3. Run "clj" or "clojure" -r.
4. Novice user asks: what is the difference between clj and clojure?
5. Ooops, I started REPL but I can't connect my editor to it....
0 votes

"Easier for beginners to install" is complected! Let's split it up.

"Easier for beginners" means not having to use administrative privileges; not having to make a commitment or risk a complicated outcome if an installer does something unexpected; files obviously partitioned (e.g., inside 1 directory) for clarity of erasing it and trying it again and again.

"Easier to install", on the other hand, is not only a tougher problem, but also perhaps a bit secondary. By the time someone is thrilled with the trial, and let us remember that these are top-1% people, they will know whether they even need "installation", and if they do need it, they will be pleased to be given no more of a red carpet than is in the nature of the task.

Leiningen sets a pretty good example (it's hard to beat "download lein" and "./lein") with not even the option of system-wide installation it avoids complications. Nonetheless, Clojure's official getting-started page is not a super place to suggest Leiningen. Lein's deep Maven consanguinity has been a great booster rocket, but a future of direct source-code-repo connections, free of a packaging step or a middleman brokering jars, is closer to Clojure's spirit.