Hacker News new | ask | show | jobs
by _halgari 3122 days ago
Well, for the first time since the langauge was created you can now do `brew install clojure`, and then `clj` on the commandline and get a repl. I would have loved something that painless when I was learning Clojure.
3 comments

Leiningen has been incredibly painless:

    $ brew install leiningen
    $ lein repl
That's literally all it took.
I agree, but it does take a while to figure out that leiningen exist

And then you learn that not everyone use leiningen ... and things become a bit more confusing than necessary for some people, especially beginners

Sorry but this whole conversation is a stretch. Anyone who looks into Clojure finds out about Leiningen. The official clojure.org even mentions it. No it's more than a stretch, it's rationalizing.
As I mentioned at length in my prior answer, this was not the primary driver.
``brew search clojure`` used to find leiningen; not sure why not now.

In fact it used to find leiningen instead of clojure; possibly clojure didn't exist as a brew tap before.

Previously, there was no brew formula for clojure and there was a hardcoded pointer to leiningen. When the clojure formula was added, that was removed.
Installing leiningen is not trivial on all platforms (Eg: Windows).Even on Linux distro repos may contain older versions of leiningen that subtly break things. Perhaps it would be better if leiningen is part of closure distribution rather than existing as separate entity.
So long as you have leiningen installed.

That isn't always trivial.

Sure it is: you can just download and run the script they have on their site: https://raw.githubusercontent.com/technomancy/leiningen/stab...

or for windows: https://raw.githubusercontent.com/technomancy/leiningen/stab...

> So long as you have leiningen installed.

I’m not sure I understood your comment. Parent’s code block has two lines: the first one installs Leiningen; the second one starts its repl.

What I meant is, so long as you have an updated version of leiningen readily available.

This is just another layer in the toolchain to contend with, and since Clojure is built on the JVM, the toolchain is already quite bloated.

leiningen also updates itself.
brew install leiningen -> lein repl does exactly that
Not only this, but also things like `clj myscript.clj` are, I think, useful to beginners.
That's very cool, yes!