Quick tip on getting lein to recognize your new dependency

Ever realized you needed to modify some dependency (e.g. I needed to add weak cache support to core.cache), go a head with forking on github, lein install your new version, modify your project.clj to pick it up, and then... somehow... you still seem to get the old version? That's usually because some other dependency is explicitly requesting a version of that library. If you do lein classpath, you'll see your library show up, in two different versions, with the one you don't want first.

In my case, the relevant bit of classpath shows

   /Users/pnf/.m2/repository …
more ...

Beauty and the Beast - Distributed functional programming, part 1

Update 2015-01-12

The algorithm as it exists in HEAD is somewhat different from the below, in ways that I'll describe (eventually) in an another post. In some ways, it's closer to Fork-Join, but with important differences to support reentrancy, share results of duplicate requests and adjust for the costs of distribution.

OSS and Commercial Grids

Grid computing has always suffered the reputation of a buzzword that one suspects might not actually mean anything, but it has become especially ill-defined with the rise of open-source distributed computation frameworks like Spark, Storm and Grampa Hadoop. These extensively documented systems don't need much …

more ...

Yeah, yeah, I should have used perl


After reading my compelling post on a clojure Slack-bot, an astute reader1 pointed out that using the fullblown apparatus of compojure, jetty, jvm, etc. for something this silly is really only justified when the entire purpose of the exercise is procrastination. Well, dear astute reader, that was the entire purpose, but you're right. Ok, here it is in perl,

    #!/usr/bin/env perl
    use Mojolicious::Lite;
    use File::Slurp;
    my $token = read_file("TOKEN");
    my @lines = split(/\0/,read_file("LINES"));
    post '/slacks' => sub {
      my $c   = shift;
      my $t   = $c->param('token');
      if ($t eq $token) {
          $c->render(json => {text …
more ...

Procrastination with a clojure M-x yow slackbot


I really should be working on this obscure distributed RDF/FRP thing, but for various reasons my head isn't working properly write now. So I did this other stupid thing instead.


Once upon a time, M-x yow in emacs would deliver a nice random quote from Zippy the Pinhead. Nowadays, you just get

Yow!  Legally-imposed CULTURE-reduction is CABBAGE-BRAINED!

which has something to do with copyright law. More specifically, the file yow.lines in emacs' data-directory now contains only the opinion expressed above, rather than the original seven-hundred or so precious epigrams, delimited by \000. I have heard dark …

more ...

Fortran, Clojure, Haskell and Julia are not at war


  • There was this perplexing article in Ars Technica about replacing Fortran for scientific computation.
  • The main performance advantage of Fortran is that its restrictive data structures facilitate vector optimization.
  • There are many ways to match and even outperform Fortran, while using other languages.
  • But it's OK to use Fortran if you want to.
  • Ars Technica notwithstanding, Clojure, Haskell and Julia are not locked in competition to replace Fortran.
  • Ars Technica notwithstanding, Fibonacci sequences may be something we learned about once, but it is difficult to disguise their irrelevance to scientific computing.


Ten or fifteen pages into a …

more ...

Sign of the Times - Managing inhomogeneously bitemporal data with Datomic and Clojure

Time is confusing. Sometimes, it's so confusing that our thinking about it changes... over time. Which makes it triply confusing, or something. In this post, I want to talk about two aspects of temporal data, both common, useful and often misunderstood:

  • Homogeneous vs Inhomogeneous
  • Temporal vs Bitemporal

Homogeneous Temporal Data

The first thing to stress is that we're talking about homogeneous data, because "homogenous" means something completely different.

In a homogeneous, temporal data set, one column will contain a known sequence of discrete time values, and the other columns will contain whatever information is associated with those times.

You would …

more ...

Orders of Magnitude for Free!

In honor of !!con, I was trying to think of programming-relevant uses of double exclamation marks. Other than denoting the end of a particularly funny programming joke (for example, a mangled homage to a famous paper), it seemed the best place to look might be in the world of double factorials. As it turns out, that wasn't as fruitful as I'd hoped, but I learned something interesting on the way to finding that out, and here it is.


You can learn interesting things about the order of complexity of an algorithm without knowing anything about how it works …

more ...

Scala for Beginners - The secret information "they" don't want you to know.

Marcus Ljungblad is going to give an amazing Scaladays talk about the process of learning Scala, and he put out a call to his fellow hackerschoolers for suggestions. I was glad to chip in, because I enjoy the opportunity to blurt out opinions without the obligation to structure them eloquently, and talking in front of people is scary, so it's awesome to have somebody else do it. Still, I kind of like my suggestions, and with Marcus' permission, I'm going to offer them here. This isn't a getting started guide, and it certainly isn't a tutorial. I'm assuming you …

more ...

FUNCTIONAL functional reactive programming, state monads and all that, in Clojure

In my last post, I talked a bit about how FRP might look if state were maintained explicitly in persistent data structures, rather than in hidden mutable structures. The accompanying code was in Scala, but my first implementation was actually in Clojure. I was originally going to use the Clojure code in the post, but, having taken motivating example code from a Scala paper, it felt lazy to switch to Clojure just because I felt like it.

That said, it really was more fun to write in Clojure, and in some ways I think it is clearer. Additionally, it seems …

more ...

FUNCTIONAL functional reactive programming

I totally agree with Paul Chiusano that the Reactive Manifesto not even wrong. In addition to the breezy non-falsifiability of its assertions, I have trouble with the name itself. Manifestos seldom work out well, in the sense of there not being a lot of corpses. (Plus which, "reactive" is acually a word, and a "reactive manifesto" doesn't sound like it would be very proactive, like.)

BUT reactive programming is important, it's useful, and I need to understand it better. Herewith, then, I shall:

  1. Very briefly introduce reactive programming as I understand it.
  2. Complain that I don't understand why they call …
more ...