4 ms·
Sure, RE performance: it's JVM vs R interpreter vs Python interpreter. JVM takes it by far. RE ETL: lists and maps are basically the main data structures in C
by usgroup 9y ago
Sure,
RE performance: it's JVM vs R interpreter vs Python interpreter. JVM takes it by far.
RE ETL: lists and maps are basically the main data structures in Clojure and resultantly you have a very large collection of functions for working with them efficiently. ETL generally is easy as a result. I don't think either Python nor R can compare in terms of expressiveness and LOC efficiency. Further, lazy sequences make it really easy to work with massive datasets because it doesn't require memory buffering. Working in parallel is really easy in Clojure. In particular fold,pmap and async channels are extremely easy to use and understand.
RE analysis: Clojure is not vectorised like R for example. Meaning syntax is not as terse for sub-setting, aggregating, etc. It doesn't support formulae as first-class citizens like R does.
E.g. filtering in R vs Clojure.
X <- D[D$type == "Seismic",]
vs
(def X (dt/where (comp #(= % "Seismic") :type) D))
E.g. aggregating in R vs Clojure.
X <- aggregate(count ~ type, data=D, sum)
vs
(def X (dt/aggregate :type #(reduce + (map :count %)) D))
Having said that it's functional, and doesn't require one to loop or to mutate, it's just not as terse.
Clojure is good for stats (because of Anglican) and good for ML (because of Java and https://github.com/thinktopic/cortex https://github.com/thinktopic/cortex).
RE viz:
Clojure sucks at Viz. There's no compelling notebook solution (Gorilla REPL...) that supports mod-cons like exporting or easy sharing.
However, I really like orgmode + babel. It makes it easy to grab data from Clojure and push it into an R block which generates graphs for example and it exports into everything.
RE macros: I haven't written any custom macros at the moment tbh. If I do in the near term it'll probably be for logging or timing. I find that the function format is extremely flexible.
RE general: Clojure has a steep and short learning curve. As in you cry for a few days but then suddenly understand loads. I also think the way of thinking it encourages is more mathematical. If you stay away from swap!, refs, agents, etc (which you can), then your world is immutable which makes testing so much easier. True error messages suck but as soon as you get a handle for how to write the code interactively with the REPL it's pretty easy to track down what causes an issue.