Category Archives: Clojure

vectormap and pvectormap

So after attending Brian Goetz’ talk and Rich Hickey’s talk at JAOO Aarhus (eer, I mean Goto Aarhus), I was thinking about how to construct Clojure data structures in parallel. To start with something that wasn’t too complex, I decided … Continue reading

Posted in Clojure | Tagged | 3 Comments

Assoc and Clojure’s PersistentHashMap: part ii

Some time ago I wrote introductory posts that gave high-level overviews of how Clojure’s PersistentVector and PersistentHashMap work. In the PersistentHashMap post I promised that “In part 2 we look at how assoc works…” – it seems I never got … Continue reading

Posted in Clojure | Tagged | 2 Comments

clj-ds: Clojure’s persistent data structures for Java

One of the appealing features of Clojure is the pervasive use of (efficient!) persistent data structures. (In previous posts I’ve shed some light on how PersistentHashMap and PersistentVector are implemented, although some of that information is slightly dated now). There … Continue reading

Posted in Clojure, General | Tagged , , | 3 Comments

Circuit Breaker: a small but real-life example of Clojure protocols and datatype

(Update July 2nd 2010: I’ve cleaned up the code and git repo. Inlined the protocol function definitions in the state records for native-platform speed. The policy can now specify which exceptions should be considered errors: this is really useful in … Continue reading

Posted in Clojure | Tagged , , , | 3 Comments

The Joy of Clojure

In case you haven’t noticed there is a very interesting Clojure book coming out, titled “The Joy of Clojure,” written by two very interesting authors that anyone hanging out in the Clojure community should know: Chris Houser and Michael Fogus. … Continue reading

Posted in Clojure, General | Tagged | 3 Comments

Understanding Clojure’s PersistentHashMap (deftwice…)

[sept. 8th, 21:22: fixed a +/- 1 error] In a previous post, I gave a high-level description of how Clojure’s PersistentVector is implemented. While the code has changed, the description was high-level enough that the explanations still hold (although some … Continue reading

Posted in Clojure | Tagged , , | 6 Comments

Clojure talks in Copenhagen and Aarhus – now with Azul Systems Clojure demo

Upcoming events: I am giving a talk on Clojure in Copenhagen and Aarhus – this is the first chance for a dcug meetup (though also non-dcug members are invited). The events are after work and free – there will even … Continue reading

Posted in Clojure | Tagged , , | Leave a comment

JAOO 2009 discount (for Clojure users ;-)

I suggested to the JAOO program committee that the JAOO Aarhus 2009 conference should have a concurrency track. Their reply was “that’s a good idea – you are hosting it!” – this is how Trifork works The good thing is … Continue reading

Posted in Clojure | Tagged | Leave a comment

One aspect of lazy computation

I’ve often needed to do a combination of filtering and mapping on arrays. E.g. in a Ruby on Rails app, I might have a list of “RecurringActivation” model objects which have a product_id and an integer period. Now I would … Continue reading

Posted in Clojure, performance | Tagged , | Leave a comment

Clojure event sourcing

Event sourcing: Event Sourcing ensures that all changes to application state are stored as a sequence of events. Not just can we query these events, we can also use the event log to reconstruct past states, and as a foundation … Continue reading

Posted in Clojure, General, instanceof | 1 Comment