Matt Raible: "Why is Clojure better than Scala or Groovy?"

Skip to first unread message


Jan 15, 2010, 8:22:08 PM1/15/10
to Clojure
Matt Raible - Spring Expert and Java consultant posted the following
entry to Twitter:
"Why is Clojure better than Scala or Groovy?"

He went on to say:
"Let's try that again: I like Scala and Groovy and see no compelling
reason to learn Clojure. Am I missing something?"

I know that I think - but I thought the awesome community here could
help answer this question.

Rich Hickey

Jan 16, 2010, 10:22:19 AM1/16/10

I would very much like to discourage the bashing of other languages
here. It is tedious and pointless. Should anyone be provoked into
responding to this, please keep your comments to attributes/deficits
of Clojure.




Jan 16, 2010, 12:22:47 PM1/16/10
On Fri, Jan 15, 2010 at 8:22 PM, Julian <> wrote:
> Matt Raible - Spring Expert and Java consultant posted the following
> entry to Twitter:
> "Why is Clojure better than Scala or Groovy?"

If I had to pick just one specific feature (which may be a bad
way to going about answering this, but anyway...) I would say

Clojure has full-on straight-up Lisp-style code-rewriting macros,
and this changes the game. Macros have a unique combination of
properties for a language feature: dramatically powerful, very
well understood (lots of material written about them), and yet
still relatively rare among popular new languages.

Many dynamic languages have meta-programming features that can be
used to fill some of the gaps left by lack of macros, so I wasn't
convinced of the power and practicality of Lisp-style macros
until I read Paul Grahams "On Lisp". I highly recommend it.
Even though it talks mostly about Common Lisp and therefore
Common Lisp macros, the macro discussions are very transferable
to Clojure.

There are other reasons to like Clojure, but that's perhaps the
simplest one to name.


Shantanu Kumar

Jan 16, 2010, 1:10:15 PM1/16/10
to Clojure

I wrote about benefits Clojure (v1.0) some time ago:

The best benefit of Clojure is, I think, the power-to-weight ratio.
The language is so much devoid of syntax and semantics bloat that
whatever code you write in Clojure is pure productivity. Concurrency-
handling makes it suitable for current-day development and as Chouser
noted, the Macros feature is a game changer.


Laurent PETIT

Jan 16, 2010, 3:35:44 PM1/16/10
One third "main selling point", just for you ;-) :

Clojure has a rooted in it a development paradigm suited to manage
state of identities over time.
That is, clojure embraces the "functional paradigm" for most of the
development process, but does not leave you "naked" when time comes to
write those parts of your application which require dealing with
state, time, concurrency, parallelism, etc.

Rich's videos are particularly enlightening concerning this point:

* a (mostly) clojure agnostic explanation of the problem and a
general solution to it:

* a more clojure-oriented talk which complements the above with clojure detail:

2010/1/16 Shantanu Kumar <>:

> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to
> Note that posts from new members are moderated - please be patient with your first post.
> To unsubscribe from this group, send email to
> For more options, visit this group at

Jon Harrop

Jan 16, 2010, 6:44:51 PM1/16/10
On Saturday 16 January 2010 18:10:15 Shantanu Kumar wrote:
> The best benefit of Clojure is, I think, the power-to-weight ratio.

That's a really good description for a low barrier to entry. :-)

Dr Jon Harrop, Flying Frog Consultancy Ltd.

Mike Meyer

Jan 17, 2010, 3:00:42 PM1/17/10
On Fri, Jan 15, 2010 at 8:22 PM, Julian <> wrote:
> Matt Raible - Spring Expert and Java consultant posted the following
> entry to Twitter:
> "Why is Clojure better than Scala or Groovy?"

How about two reasons to learn Clojure instead?

1) Clojure is (a) LISP. According to Eric Raymond, "LISP is worth
learning for a different reason — the profound enlightenment
experience you will have when you finally get it. That experience will
make you a better programmer for the rest of your days, even if you
never actually use LISP itself a lot."

2) Clojure is designed from the ground up for concurrent
programming. It has a number of mechanisms that improve on locks for
managing state. Those come from other languages, and are liable to
appear in yet more languages in the future. If you're doing concurrent
programming, learning them will make you a better concurrent
programmer. If you're not doing concurrent programming, consider that
CPU improvement has changed from an exponential growth in raw speed to
an exponential growth in number of cores.

Mike Meyer <>
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail -

Keith Irwin

Jan 17, 2010, 7:12:18 PM1/17/10
I don't think you can really answer the question because it being asked in the way it that precludes a good enough answer. The tone of Matt Raible's request suggests that he'd really rather not learn it, and that there's no possible reason to overcome that reluctance.

Why travel? There's plenty of good food right here, and interesting cultural sites to see, and stuff to buy. But you don't ask that question: you just go, and FIND OUT why it was worth doing after the fact. (Or maybe not.)

Still. My take:

1. Clojure is dynamic like Groovy, and functional like Scala, so if Matt learned it, he'd be able to see what that's like.

2. It's a Lisp, and that's worth trying at least once, but it's on the JVM and a new dialect, so it lets you write Java in Lisp at first, and the lets you enjoy beginning to see new ways of thinking about problems.

3. Clojure has a flavor of STM that's database-like, and easy to use for the non-theorist programmer (i.e., folks like me who just write dorky business apps that aren't much more than shoving data to/from the web/database). This really cuts down on "threading" bugs, which are super hard to diagnose when the errors occur in production, which is always locked down and inaccessible to devs, debuggers, etc. STM doesn't help distributed concurrency (for which actors are better, imho), but it does help for a wide range of non-distributed use cases.

4. Clojure's macros make domain specific languages a natural part of programming. While Groovy's various Builders are pretty nice, it's not so easy to write your own builder, esp. if you're under pressure to get something done. For instance, I write a lot of Groovy apps, and I want something like Compojure. But the idea of figuring out how to use the Builder Support to do something like that just makes me tired.

Really, though, it's so hard to convince someone that one language is better than another significantly enough to be "worth learning" using "reason" or any other method. One just has to try it.

For me, Clojure/Lisp just works the way I do. Incremental, small functions, interactive, etc, etc generally as a result of super-vague requirements. Every time I write an app in it, I feel like the app gets smaller and simpler over time. I let myself write a lot of boilerplate (to avoid premature abstraction), then condense it all in a way that fits my app (not, say, a general lib), and the whole experience of it is positive. Better, smaller code, faster, and more fun to do (even if it's the same old business tasks).

So, Clojure "wins" or is "worth trying" because of the experience of using it, not because of some particular bullet point, which all languages feel like they all have.

(Personally, I'd really love Haskell/Erlang like pattern matching, not just destructuring or multi-methods (but those, too!), but even so....)

Didn't Paul Graham say something to the affect that a user of a "blub" language just can't see the point in other languages? I don't think Groovy and Scala are blub languages, but I think the idea applies, at least in an emotional way.

Matt should just give it a few weeks' try, like Tim Bray did.


Reply all
Reply to author
0 new messages