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

There's a lot of new small improvements in this update which are great for Clojure users, but the fundamental difference between 1.4 and 1.5 is the reducer library which was implemented. It's added mostly for performance reasons: By using this library, you will utilize Fork/Join in Java, but with a functional interface instead of the "gory" one. Very interesting, because the complexity of a typical `(reduce (map ...))` won't change, and you're suddenly utilizing all the cores on your computer. Rich Hickey had a talk about the new Reducers library[1], and I'd recommend you to see it, as it gives you a good understanding of how it works (and why it was implemented that way).

Another slightly interesting thing is the sudden enhancement to read-eval and EDN[2]. That's mainly because of the rough weather Ruby/Rubygems was in with the YAML-exploits, which caused a heated discussion on how the Clojure reader should act by default[3][4].

[1]: http://www.infoq.com/presentations/Clojure-Reducers

[2]: https://github.com/clojure/clojure/blob/master/changes.md#21...

[3]: http://dev.clojure.org/jira/browse/CLJ-1153

[4]: https://groups.google.com/d/topic/clojure-dev/zG90eRnbbJQ/di...




One my favorite features that came out of reducers - short circuiting reduce!

   (reduce 
     (fn [a b] 
       (if (> a 100) (reduced a) (+ a b))) 
     (range 100000))
   => 105
I've often had to use loop/recur instead of reduce because you could not short circuit. No longer.


YES, I was hunting around for this in 1.4, happy to see it's arrived.


This is so beautiful, like recur's blessing in disguise.


cool




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: