Hacker News new | comments | show | ask | jobs | submit login

I'm looking at both Scala and Clojure right now. I'm a .Net guy these days, looked hard at (and fell partially in love with) F#, but - I need to broaden my field.

And - I'd like to see if I can (ab)use those languages to improve my experiences with Android.

So far I'm heavily leaning towards Scala. The documentation seems to make more sense to me. It seems powerful to ~no end~. This post now, while being not totally impressed about all things Clojure, ends with an unqualified 'still more usable than Scala', which threw me off.

More data points, please? If the writer is true and makes sense: What's the reason for this comment? Convert me. :)

The difference between Scala and Clojure, in my opinion, is primarily one of philosophy.

* Clojure is strongly and dynamically typed. Scala has a complex type system, which from what I understand many Scala developers don't fully understand or utilize it. Clojure doesn't suffer much in performance, however, because you can sprinkle in type hints for performance after the fact wherever it turns out to be necessary.

* Clojure is a Lisp. The benefits of that are a whole other discussion, but homoiconicity and macros are undoubtedly pretty cool.

* Scala is multi-paradigm, Clojure is unabashedly single-paradigm.

* Scala includes the kitchen sink, Clojure is highly opinionated about what it provides. As Brian Hurt says, "It's not what a programming language makes possible, it's what it makes easy." For one example, you can do immutability in Scala, but you're also free to go in and make a hairball of state if you want. Clojure has decided immutability is good, and forces you to manage state in a controlled way.

* Clojure is less complex (in the sense Stu Halloway uses the word in his talk on Simplicity, http://blip.tv/clojure/stuart-halloway-simplicity-ain-t-easy...)

Full disclosure: I'm a huge Clojure fan and author of Practical Clojure, and haven't used Scala on any nontrivial projects, so I'm probably somewhat biased.

> Scala has a complex type system, which from what I understand many Scala developers don't fully understand or utilize it.

"When we say that a language is expressive, we mean that it is easy to use. When we say that a type system is expressive, we mean that it isn't."

- Gilad Bracha

Well, if your interest is to release on Android in the immediate future, you may be best served by sticking to Scala. Clojure code needs to bootstrap itself at start-up which creates a bit of a load delay on the initialisation of your app. If you want to just throw up a splash screen and not worry too much about the load time, Clojure may work out fine.

At this point, I have written significant amounts of code in both languages, and I honestly prefer Clojure. Scala is definitely a big step up from Java, and there is a lot to like in the language. Nonetheless, I think that Clojure is a step up from Scala.

There have been a number of times when writing in Scala that I wish I had some of the features of Clojure, macros in particular. Scala provides many neat features that would be implemented as macros in Clojure, but there are some things that can be done as macros that cannot be done in Scala.

Of course, typing is a big issue. I'll have to admit that when writing client code static typing is very nice, but when writing library code dynamic typing makes things easier. Most importantly, Scala suffers from some of the typing problems that are part of the JVM, most notably: type erasure in generics. Scala provides some means to reify generic types, but it is still a pain to work with. I think that Clojure also contains superior polymorphic dispatch capabilities.

In the end, they are both fine languages. I enjoy coding in Scala and Clojure more than C++ or Java. Still, if I have the choice between the two, I'd go for Clojure.

I found that comment strage. Scala is quite usable once you start actually, well, using it. If you just read through the docs it can be intimidating but if you start using it as a "better Java" and then start biting off the more sophisticated features it's not hard to get going at all. Having tried both Clojure and Scala there's no way I'd throw away the benefits of static typing in a good, modern FP.

However, my money is on neither. I'm looking forward to Kotlin from Jetbrains: http://confluence.jetbrains.net/display/Kotlin/Welcome

uff, it's controversial territory... scala is certainly closer to f# than clojure. that could be good - easier to learn - or bad - you learn less (i would strongly encourage learning one lisp, and working through "on lisp" to grok macros, if you haven't done so yet). my problem with scala is that i found it too complicated. i was really frustrated and disappointed with it, and that was exacerbated by my hope that it was the future (i thought it would be haskell for java programmers - and it is, in a way, but it achieves it through brute force rather than elegance, imho). but that was just me, and some time ago (when the language was changing more rapidly) - it may be better now, or for others...

What made Scala too complicated? The type system, or something else?

it comes from the need to support java (which is of course also the language's great strength). see for example http://stackoverflow.com/questions/3689407/disadvantages-of-... or http://programmers.stackexchange.com/questions/51245/what-ki... - answers there discuss the tension between types and java (especially the long first answer in the second link).

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact