3 ms·
The usual argument for Clojure is that it allows for short and succinct code; but actually, Scala code is about 10% shorter: its type system is good enough so t
by auggierose 13y ago
The usual argument for Clojure is that it allows for short and succinct code; but actually, Scala code is about 10% shorter: its type system is good enough so that you can do almost anything with it in a similar elegant and short fashion as in Clojure.
Programming in Clojure I miss the following features from Scala most:
a) Pattern matching
b) Having machine-checked documentation (aka type system), traits.
c) A proper documentation generation tool. The Clojure one doesn't do protocols properly, although protocols are the only real way in Clojure to have something akin' to interfaces and Scala traits.
- bdisraeli 13y agoFor a and b you should check our core.match [1] and core.typed [2]. One of the best parts of using lisps is that things that are features of other languages can be implemented as libraries. Not to say Scala probably isn't great too, but I haven't ever really used it. [1] https://github.com/clojure/core.match https://github.com/clojure/core.match [2] https://github.com/clojure/core.typed https://github.com/clojure/core.typed
- narwally 13y agoIIRC Clojure itself is a library.
- brandonbloom 13y agoNot trying to sell you anything, just trying to help you find some things you've been missing: a) https://github.com/clojure/core.match https://github.com/clojure/core.match b1) https://github.com/clojure/core.typed https://github.com/clojure/core.typed b2) I agree that Clojure's facilities for mixins is under-utilized and that it lacks a proper facility for delegation (ie implicit conversions in Scala), but see (doc extend) for how awesome "traits as data" can be. Here's an example: https://github.com/stuartsierra/clojure.walk2/blob/2250e04c792aea161092279e74f8f7fa0229f818/src/clojure/walk2.clj#L43-L47 https://github.com/stuartsierra/clojure.walk2/blob/2250e04c7... c1) I hate generated documentation, but I understand why it's necessary for Scala. When I did some scala programming, I was so pleased with ScalaDoc, since it really helps you navigate that complex scala.collections hierarchy. Feels like having a pretty decent substitute to a good IDE. In Clojure, I don't feel the need nearly as much... Also, I quite like reflective documentation with the doc macro. c2) Already covered interfaces/traits in b2