Clojure Weekly, May 14th, 2013
Welcome to another issue of Clojure weekly, my small routine blog contribution to the Clojure sphere! These are just a few links, normally 4/5 urls, pointing at articles, documentation, screencasts, podcasts or anything else that attracts my attention. I add a small comment so you can decide if you want to look at the whole thing or not. That’s it, enjoy!
Prismatic’s “Graph” at Strange Loop — Prismatic Blog The team at Prismatic is putting a lot of effort in open sourcing their common solution to recurring problems (aka patterns). Graph is part of the Prismatic tool-belt. Basically, it is a way to express a functional composition in terms of a graph based data structure. Instead of a function with a lot of outgoing dependencies to lower level abstraction (and those functions may also be calling into each other) Graph allows to declare what output of which function should be the input into another function. I can see some relevant cases where this can be useful, for example composing chains of responsibilities that otherwise would result in big monster let-blocks at the beginning of a function. At the same time I fail to see how the same problem could not be solved by a better composition and abstraction of functions. I have the impression that if a function is calling into many other functions I might be missing a layer of abstraction and that would be my first attempt at refactoring instead of using graph.
michalmarczyk/flexvec · GitHub Here’s an example of how an interesting and efficient algorithm that improves the current 32-way branching tree used in Clojure vectors can make it as a contrib and maybe to core one day. Relaxed radix balanced trees (hence “flex” because the constrain about the branching is relaxed) are an alternative implementation for balanced trees that allows more efficient concatenation in log(n). The pay a small performance price just after the first concatenation for simple addition operation, but if the vector is never concatenated you get exactly the same B-Tree behaviour of the current Clojure implementation. It was discussed initially in clojure-ML http://tinyurl.com/cs6tuyl and quickly after in clojure-dev http://tinyurl.com/bvby85s and finally ended up in contrib. This data structure can be useful in all cases where concatenation of immutable vectors is used heavily: fork-join kind of operations or simple map-reducing operations producing a vector instead of a scalar.
Dashboard [Hudson] All of Clojure and Clojure contributions are continuously integrated in a Jenkins instance running at the link above. It is kind of interesting to see when it was last built and when it was last failing. For Clojure for example you need to go way back to see a failure (on an external Ant task). The http://build.clojure.org/job/clojure-test-matrix/ job tests Clojure on several JDK versions and you can see that JDK 1.5 was lost in February and seems unrecoverable.
jaycfields/jry · GitHub Jry is a library of helper functions. I trust the source of them (Jav Fields) so I’m going to keep an eye on the functions there for the future. There are a few things I had to copy paste from snippets from somewhere else present here (like update-values in a map or keys) plus some ideas for names I never thought about like -> to denote transform-this->to-that.
Excision | Datomic Datomic is designed following the principle that information is a stream of events that happen and events are never really removed from history. But there are some cases where data are explicit required to not exist anymore, for privacy reasons or other non-technical related requirements. For this reason Datomic can be requested to forget about data using the excise attribute on a specific ID in a transaction. Excision can be based on a specific time window as well. The funny part is that Datomic can’t forget that you asked to forget. So the excision attribute allows to track what was excised but it can’t be excised itself.
6 days ago