Author Archives: david

Cashew and butterbean non-mous

I’ve never had much success with making my own hummous. Whenever I try I end up with something which is ok, but generally a bit stodgy and unexciting.

Earlier I remembered the following amazing dish from vegan yum yum and it occurred to me that the cashews made it much ligher than the beans on their own would have. And thus was born the following recipe:

Ingredients

  • A can of butterbeans
  • 1 cup of raw cashews (I buy these broken and loose from a health food store, so they’re actually quite affordable)
  • 1.5 lemons (whole, but with the peel removed)
  • 1.5 tsp sea salt
  • 1 tbs olive oil
  • 2 tbs tahini

Instructions

The exact process I used to make it involves 73 distinct and precise steps and requires attaining nirvana before its completion. As a fractionally simpler alternative, I recommend just sticking the entire lot in a food processor and blending until it’s smooth.

Result

This is very distinctly not hummous, but it is nevertheless delicious. It has a fairly mild flavour – you can distinctly taste the lemon and cashews, but they don’t dominate – and has a nice creamy texture. Probably works better as a pate rather than a dip, but definitely great for either

This entry was posted in Food on by .

Interest bandwidth

Highlight from the #scala IRC channel:

13:21 < DRMacIver> I have a somewhat unfortunate theory. I suspect the amount one cares about programming issues is inversely proportional to how inherently interesting one's work is.
13:22 < DRMacIver> Or at least negatively correlated
13:22 < ijuma> DRMacIver: is this based on personal experience? ;)
13:22 < DRMacIver> Yes
13:22  * DRMacIver finds it much harder to get worked up about language issues these days
13:23 < DRMacIver> Which is in large part because I'm doing a lot more interesting borderline computer sciencey work
13:24 < dgreensp> yeah, I do a lot of interesting work and only rarely stop to think about languages
13:24 < ijuma> yeah, I noticed. I think it makes sense. People have limited bandwidth and if work is interesting, it's likely to take quite a bit of it
13:25 < DRMacIver> I think the other issue is that people want to find what they do interesting. And so if *what* they do isn't interesting they have to become interested in *how* they do it.
13:25 < DRMacIver> But yes, the bandwidth thing is also a big part of it
13:26 < dgreensp> bandwidth minimum, bandwidth maximum :)
13:26 < DRMacIver> ?
13:27 < ijuma> DRMacIver: agreed
13:27 < dgreensp> er, the two points seemed related -- people need to be interested in something, but they can't be interested in too many things at once
13:28 < DRMacIver> Oh, right.
13:28 < DRMacIver> Yes. That's a good way of looking at it.
This entry was posted in programming and tagged , , on by .

A problem of language

I try to stay out of language wars these days. I find the whole endeavour incredibly tedious. I don’t really feel like arguing whether OCaml is better than Ruby is better than Scala is better than brainfuck is better than C. I like them all (ok maybe not brainfuck), and there are valid arguments for and against each of them.

But one thing I have a lot of trouble with is bad arguments. Not “arguments I disagree with”, but arguments which are simply outright bad.

Robert Fischer has a post on his blog: Scala is not a functional language. It’s not the first time this idea has come up. It’s not an idea entirely without merit. Scala’s functional features are certainly not as seamless to use as one might hope.

The problem is that while it is not an idea without merit, its presentation is certainly one without content. As per usual, every time this comes up, no one is actually willing to say what on earth they mean by “functional programming language”. This problem is ubiquitous. Consider the following wikipedia entry:

In computer science, functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data. It emphasizes the application of functions, in contrast to the imperative programming style, which emphasizes changes in state. Functional programming has its roots in the lambda calculus, a formal system developed in the 1930s to investigate function definition, function application, and recursion. Many functional programming languages can be viewed as embellishments to the lambda calculus.

Notice the bait and switch there? It defines “functional programming” and then talks about “functional programming languages“. Everyone does this. The only unambiguous definition you find which includes the term “functional programming language” is that of Purely functional language. This is much less ambiguous, but it’s also the case that the vast majority of people arguing about whether Scala (or other language of choice) is functional are comparing it to a decidedly impure language. Certainly neither Clojure nor OCaml are purely functional.

On the other hand, if you choose “functional programming language” to simply mean “supports functional programming” then suddenly you have to acknowledge various languages like Ruby as functional and for some reason this makes people uncomfortable. So instead we end up with all sorts of hand waving and mumbling and no one is able to have a useful discussion because everyone is too busy making assertions which can’t be argued with because they don’t mean anything.

So no one defines the term, but everyone seems to “know what it means”. And what it inevitably means is “shares features with this language which I use and like and consider to be a functional language”.

For a particular extreme example, consider the following conversation on reddit from the last time this subject came up:

vagif:
Well, here’s my understanding of this disagreement.
I think many people (me included) do not feel that Scala is functional enough. It is not because of the mutable variables. It all boils down to simple syntax. That’s why completely imperative and old fashioned language CL (i use sbcl) feels to me much more functional than Scala will ever be with its modern functional features like pattern matching, type inference and list comprehensions.
“Functional” for me means simple small core of orthogonal features.
“Functional” for me means – List processing.
“Functional” for me means no premature optimization (deciding to use arrays instead of lists because they are faster etc.)
Obviously, trying to accommodate java OO model, makes Scala way to complicated, arcane, baroque in its syntax, to feel functional enough.

DRMacIver:
I enjoy the fact that the word “function” does not appear in your definition of functional…

vagif:
And for a good reason. Functions are part of any imperative language. That does not make them more functional. It is all that infrastructure, that allows for easy juggling those functions, that makes a language functional. Passing them as parameters and return values, anonymous functions, closures, polymorphic functions (be it a result of type inference or dynamic nature of language). It is this small core of orthogonal features, all geared up for list processing, that truly creates a functional feeling in a programmer.

This sort of woolly thinking is endemic in these arguments. Please try to avoid it. If you’re not willing to define “functional programming language” in a way that is at least moderately unambiguous and doesn’t involve arguments about “feelings” or simply feature comparisons with some language which you state as an example of functional programming, don’t bother making arguments about whether a language is functional or not.

Of course, once you start defining the term people will start arguing about the definitions. This is pretty tedious, I know. But as tedious as arguing about definitions is, it can’t hold a candle to arguing without definitions.

This entry was posted in programming and tagged , , on by .

A hectnical digression

On the archihecture of @HectorTheFrog:

David: *says hect rather than hects*
Victoria: Hect.
David: (on the subject of which, I’ve just turned up hector’s tweet rate)
Victoria: How fast can he hect now?
David: So the way it works is that there are two parameters that control when he hects: At a fixed rate he thinks “Should I hect?”, and given that he is wondering whether to hect there is a certain chance of him hecting.
David: He was previously making hectsisions once an hour and had a one in fifteen chance of hecting. I’ve changed it so that he’s still hectemplating only once an hour but instead had a one in 7 burble chance
David: So he can hect once every hour, but he’ll probably hect about once every 7 hours.
David: (ask a simple question, get an overly hectnical answer :-) )
Victoria: oh my god that’s the most adorable hectnical answer ever

This entry was posted in Hug the frog on by .

Hug the frog

Hect?

hect1

Those of you who follow me on twitter might have noticed I’ve been annoying you with a new hashtag recently.

hect2

This is the result of a silly little project of mine. Hector is a frog. Specifically, he is a Kelig Groda who lives on top of Victoria‘s bookshelf. He says Hect a lot.

hect3

The other evening, it occurred to me that the repetitive nature of his hecting made him practically a model twitizen. So we set up a twitter account for him (disappointingly, “Hector” has been taken by a non-entity who stopped using twitter after two posts and didn’t delete his account). He automatically updates based on an utterly trivial script, and occasionally Victoria or I will manually post with him.

hec5

As a consequence of being a large fuzzy air filled cube, Hector is very huggable. In fact, he is the most huggablest frog ever (yes that’s a word. Firefox hasn’t even given me a squiggly red line for it)!. This is a very good way of relieving stress. So, if you’re having a stressful day, we really must encourage you to #hugthefrog

All of these pictures are in fact not of Hector, but from a set of Kelig Groda pictures which piscue has kindly made available under a creative commons license on his Flickr account. We have gratefully used these for both this post and Hector’s user icon.

This entry was posted in Hug the frog on by .