Here’s real news: Alex Osborne of National Library of Australia, also known as @atosborne, whom I first met on #clojure, took the Wide Finder bit between his teeth and has posted a remarkable implementation story: Widefinder 2 with Clojure. Um, 8m4.663s! If you care about any aspect of this stuff you really ought to go read it now. Grab yourself a coffee or whatever first; it’s not short.

[This is part of the Concur.next series.]

I’ll be giving it some more thought, but here are a few early reactions.

In his coda, Alex reveals that he’s only been using Clojure for a couple of months. I’m awed and humbled; this guy’s got some chops. I think that this chunk of code and annotation can be monumentally useful as a teaching tool. Well, and being able to process big logfiles fast is always a good thing.



Contributions

Comment feed for ongoing:Comments feed

From: Alex Osborne (Dec 16 2009, at 03:09)

I see being able to reuse Java's types as a benefit of Clojure, not something lacking in it. I could have used some other scheme but when there's a tool that fits perfectly why not use it? An atomic counter is what I needed and that's exactly what an AtomicLong provides. I guess you could wrap it in couple of functions so it behaves more like a Clojure type, but aside from the ugly type hints it's really quite easy to use as is, so why bother? Fine-grained atoms can do the same job but they are a more general purpose tool and hence incur a little overhead in exchange for their flexibility. :-)

After all, what is a Clojure atom? Naught but a wrapper around an AtomicReference with a convenience function (swap!) for doing compare and set and a few Clojure additions like metadata and watchers.

I think the lessons learned from the exercise are much more important than my particular code. Thanks for suggesting the problem, Tim -- I really learned a lot from this and encourage everyone to have their own go at it with their own tools of choice. If the tool you pick happens to be Clojure take what Tim and I have discovered and try to do even better. I'm sure there's a lot of room to improve both in performance and in elegance of the solution.

[link]

author · Dad
colophon · rights
picture of the day
December 15, 2009
· Technology (90 fragments)
· · Concurrency (76 more)

By .

The opinions expressed here
are my own, and no other party
necessarily agrees with them.

A full disclosure of my
professional interests is
on the author page.

I’m on Mastodon!