by galfarragem · 6y ago · 0 comments
- Easy to get started: one click install, great website and concise docs. No matter what some people say, getting started in Clojure is a nightmare.
- Lightweight and fresh. No JVM, no Node.
- Freedom and expressivity. Mutable or immutable data structures, ultimately is up to me. It might bite me down the road but for now it feels great.
So we need players. I would rant here, but I won't. But look at this guitar player with blisters. A harpist has blisters, a base player with blisters. There's this barrier to overcome for every musician. Imagine if you downloaded something from GitHub and it gave you blisters. - Rich Hickey (Design, Composition and Performance)
Clojure seems more concerned with power, expressiveness, and reach, rather than ease of use. Does this alienate new users, sure, but the Clojure community seems OK with that as a trade-off.
It's like you were getting blisters from stringing your guitar. You buy a guitar, get home, and it takes three days to open the case. Then another week to figure out which strings go where. God help you when you realize you have to tune the thing.
Two, five, seven days pass and you haven't played a note. I don't think that's what Hickey meant.
That said, it's worth it.
An example would be Clojure's newish approach to managing projects via the CLI and deps.edn. It's very powerful, and expressive, but definitely not a one-click approach.
But as I recall the original Rich Hickey talks on "Why Clojure?" he was explicit that dependency/project management were very hard problems that Clojure didn't really attempt to solve.
I'm not aware of any Clojure tools that are best-of-breed for project management. Java has a better model for locking everything down (or maybe how the Linux Distros manage their repositories) and Python has a better model for just keeping up with the current state of things. I'm not aware of any half-and-half model that gives satisfying results.
Clojure is inferior to Java in that aspect because the number of things to keep track of roughly doubles (for every concept there seems to be a Clojure version and a Java version) and library management is bizarre and warty - see also the horrible import/require/use/some other one I can't even remember mess. And then there is unpicking the syntax differences between using things in the (ns) macro vs calling direct. I dunno; maybe something changed but that part of the experience is a mess. Unusually poorly done in Clojure too, everything else was so lovely.
I never got on top of it and I tried for months; as evidenced I can't even remember how to load a library after putting it down for a little while. Even assuming the classpath is correctly set. What would have to happen for a C programmer to forget #include "name.h" ?
You just need Java installed on your system, then you install clojure (via brew, or sh install) and that's it, you're good to go.
I've written a guide to starting with Clojure covering installation to REPL & IDE configuration: https://grison.me/2020/04/04/starting-with-clojure/
In an extreme case, someone who doesn't know Java ecosystem might want to stop to research: what is JVM, why is it necessary, which version would be the best, what's the difference between Oracle's Java and OpenJDK, etc...
Out of the top of my head:
- There is the Python 2.7/3.X situation still going on, then there are the several distributions of python.
- GNU's R has a similar problem
- Installing gcc on windows was (perhaps still is) a confusing mess for a newcomer.
IMO I did not find installing clojure any harder than installing Scala for instance, and yet I have never heard (anecdotal, I know) complaining about Scala.
You might not share that users preference of caring about the installation experience of a PL, but arguing that this user's preference is somehow unfair because many other languages also have bad installation experiences makes absolutely no sense.
The vast majority of PCs are Windows, not Mac or Linux. Though WSL2 (available with Windows Insiders) makes working with Linux software a breeze, it's not the standard flow. Java isn't installed by default, either.
Your guide suggests using WSL and IntelliJ. Does IntilliJ actually work with Closure running in WSL? For that matter, does the VS Code plugin?
These are all headaches a new programmer won't have when getting setup with PHP, Python, JavaScript or most popular languages.
I think this is especially disappointing because there are mature, cross platform solutions available but whoever manages the Clojure project seems hell bent on pushing their "clj" tool which is, clearly, treating cross-platform concerns as an after thought. The Clojure organization conducts a survey every year and this is hurting their adoption with developers on Windows.
"One new question we asked this year was about the primary developer operating system to give us better guidance about tool-related work. As expected, MacOS was the leader (55%), followed by Linux (35%) and Windows (9%)"
Getting started with Leiningen, in my opinion, is much easier although, as has been pointed out, installing a JDK is an extra step that other languages don't have.
[0]: https://clojure.org/guides/getting_started
[1]: https://clojure.org/news/2020/02/20/state-of-clojure-2020
I'm doing a lot of Clojure since years both on my MBP and on Windows and there's no problem at all doing that way. Besides VSCode even has a plugin for WSL which will let you directly hook into it.
So yeah there are some questions like which Java to install, which IDE, .. but these questions are the same for other programming languages.
If you have any hint regarding how to improve my guide don't hesitate to tell me if something is not clear in it :)
Probably the biggest thing would be to assume the person reading the guide has a brand new computer and hasn't installed anything yet (including Java and Homebrew).
It's really hard to assume much about the background of someone just trying a new programming language. Maybe they've worked with other languages and you're familiar with, maybe not.
A Lisper sees a REPL, and thinks they have "gotten started." When I think most language learners don't think they have "gotten started" until they, on the low end, have printed something at a familiar terminal, or, on the high end, pointed a web browser to localhost:8080 and seen some text there.
I don't see who the "clj" shell script is somehow "part of Clojure" any more than Leiningen or Boot. IMHO it's just a shell script and it works similarly to the other tools, except not in any way cross platform.
And how to work with vscode as it all fails, at least windows.
But love clojure syntax. In particular I found it hard to see all () and the simple added some syntax sugars help the eye a lot.
Hence jump to janet. In fact the community is very helpful.
Not sure but the size is small enough to see whether one can do embedded as I try picolisp but it is bounded to a low end Env.
Very promising.
Btw the whole point I later schedule more time to try clojurescript to ... May be that can wait a bit.
2 - Dowload clojure.jar
3 - Start command.com or PowerShell
4 - cd into clojure installation directory
5 - java -jar clojure.jar
What there should be is an exe or MSI installer like every other Windows program.
...
2 - Download clojure-1.10.1.jar, spec.alpha-0.2.176.jar, core.specs.alpha-0.2.44.jar from mvnrepository.com
...
5 - java -cp clojure-1.10.1.jar;spec.alpha-0.2.176.jar;core.specs.alpha-0.2.44.jar clojure.main
command.com? Is it 1995?
CL is a breeze. Even installing new dependencies into a running image is a breeze, and no need to restart anything.
You don't even need to leave the REPL!
Idunno, I read the whole homepage and I don't really know where to go to download it. Is "clone and run Meson" what you meant by "one click install"?
> No matter what some people say, getting started in Clojure is a nightmare.
On my distro I just do pacman -S clojure and I have a working clojure environment, on everything else it's usually available as one package. Not much of a "nightmare" to my eyes, at least when compared to Janet, which doesn't tell you how to install it anywhere on the website.