Live data from Hacker News

Clojure 1.9 is now available

blog.cognitect.com

11–20 of 121 posts

Re: Clojure 1.9 is now available

#11
post #2

Can anyone sell me on why I should use clojure over say, any of the other nice Lisp-1s, given that I don't care about java.

It has a strong focus on immutable data structures and good concurrency primitives. True that you can get these in libraries for other lisps, but having the entire eco-system based on them is a big selling point.

Re: Clojure 1.9 is now available

#12
post #2

Can anyone sell me on why I should use clojure over say, any of the other nice Lisp-1s, given that I don't care about java.

I wouldn't try to sell you on it. Languages are tools, so your question is like asking "can anyone sell me on why I should use a flashlight instead of a cheese grater?" I don't know, because I don't know what you're trying to do. Perhaps neither Clojure nor Lisp is appropriate. Basic sales pitch: use the right tool for the job.

For many of us, Clojure(Script) is the right tool: a balance of performance, ecosystem interoperability, expressiveness, etc. on the platform we're targeting.

Re: Clojure 1.9 is now available

#13
post #2

Can anyone sell me on why I should use clojure over say, any of the other nice Lisp-1s, given that I don't care about java.

Immutable by default

Lots of support

Great interactive workflow (with Emacs, Intellij, or Atom)

Data oriented (Most of your code are pure functions making

simple operations on datastructures)

Re: Clojure 1.9 is now available

#14
post #9

Earlier quoted context omitted.

Yes, but I'm confused. The website still says specs still in alpha so whats the deal? Is the spec api now stable?

Spec is still alpha as far as I'm aware. They decided to break spec off into it's own library because it was holding up the release of 1.9.

The API is still subject to change (alpha) but those changes are not expected to be dramatic at this point.

Re: Clojure 1.9 is now available

#16

Why focus on command line tools? There's already Leiningen which does an amazing job, and Boot for the few use-cases Leiningen doesn't take care of. Creating another CLI seems very strange.

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.

Re: Clojure 1.9 is now available

#17
post #2

Can anyone sell me on why I should use clojure over say, any of the other nice Lisp-1s, given that I don't care about java.

Why would anyone want to sell you on something?

Do you want to be sold on it? Is that what you want your interactions on this site to be?

Re: Clojure 1.9 is now available

#18

Why focus on command line tools? There's already Leiningen which does an amazing job, and Boot for the few use-cases Leiningen doesn't take care of. Creating another CLI seems very strange.

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.

brew install leiningen -> lein repl does exactly that

Re: Clojure 1.9 is now available

#19

Why focus on command line tools? There's already Leiningen which does an amazing job, and Boot for the few use-cases Leiningen doesn't take care of. Creating another CLI seems very strange.

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.

Leiningen has been incredibly painless:

    $ brew install leiningen
    $ lein repl
That's literally all it took.

Re: Clojure 1.9 is now available

#20
post #2

Can anyone sell me on why I should use clojure over say, any of the other nice Lisp-1s, given that I don't care about java.

Associative data structures (maps / dicts) are super first-class in Clojure, in a way that they aren't in other Lisp-1's (at least from what I remember of dabbling in Racket). There's a literal syntax for them. Keywords are functions that you can call with a map as an argument. You can destructure them in `let` bindings. And so on.

In my opinion, this turns out to be a pretty major win. Code is still data, it's just that this data is a mix of lists, vectors, and maps, and now you can type associative data structures into your code as easily as you can lists. Hash tables in vanilla Common Lisp are a nightmare (there is a nice library that at least gives a Clojure-y initialization option via Reader macro), and a glance at the Racket documentation suggests the story there is probably not much better.

Clojure code in the wild uses the destructuring on maps a lot like, e.g. Haskell code uses pattern matching, and Spec is an interesting core library aimed at allowing libraries to insist that keys be present in maps and so on.

Anyway, I had occasion to interact with some Common Lisp code I'd written several years ago, and I was struck by how annoyed I was at it for not being Clojure. Part of that is the Lisp-2 issue, but I also really missed how lightweight and easy Clojure maps are, and how easy they are to use for control flow. (I will say that Clojure's clunky recursion annoys me, but much less than trying to deal with Hash Tables in CL)

Also, and I know you say you don't care about Java, but ... sometimes you have to interact with some annoying outside system (like, a database or a web browser), and there is a high-quality Java(Script) library that makes this task trivial and lets you work on what you want!

Post reply on HN