Archive for February, 2007

An analogy

Tuesday, February 20th, 2007

Suppose everyone communicates via scribes, who write in ancient Egyptian hieroglyphs, and Microsoft is the only company who trains them.

Now there do exist some talented linguists who can figure out approximately what they’re writing. That’s what the Rosetta Stone was about, except in this analogy there’s no Demotic or Greek alongside, only the hieroglyphs and a scribe to tell you what they mean in English. Unfortunately, after they send the scribes away, the linguists can never be sure that they’ve got it right, especially since Microsoft can change the language as they like simply by changing the curriculum. As soon as new scribes start writing in this new language, the old scribes will stop being able to interpret some messages you receive because they don’t know about the changes in the language.

(more…)

QOTD IX

Saturday, February 17th, 2007

The idea that a successful person should be happy has thousands of years of momentum behind it. If I was any good, why didn’t I have the easy confidence winners are supposed to have? But that, I now believe, is like a runner asking “If I’m such a good athlete, why do I feel so tired?” Good runners still get tired; they just get tired at higher speeds.

Paul Graham. An interesting essay, which (indirectly) suggests that the reason why people seem more discontented these days is that more of them do jobs where it’s not possible to know you did the best you could. I already know that manual labour is more “satisfying” in this sense than intellectual labour, so in hindsight this idea seems obvious.

A spot of psychoanalysis

Friday, February 16th, 2007

Sean, your timing is spooky. You always seem to manage to blog about something just after I’ve been thinking about the same things!

I don’t recall ever being in a long-term comfort zone. Even when I was feeling ’comfortable’, it was because I was lazy and indulgent, not making the most of life, so I felt guilty. Is this a good thing? I certainly don’t feel good because of it.

I’m at quite an odd stage in my life right now. The monkey (or id) is telling me to settle down, make long term friends, find happiness. But the other part (in psychoanalytic terms, the ego) recognises that settling down at this stage is a kind of prison, so I know I can’t be truly happy that way.

Results

Tuesday, February 13th, 2007

Here are this semester’s exam results:

  • Functional Programming 2: 49%

  • Designing Algorithms: 62%

  • Foundations of Artificial Intelligence: 71%

AI was the one I spent the least amount of effort on, so getting a first in it is pretty surprising. Even more surprising though is the third for Funky 2, especially as I feel as if I’ve been eating and sleeping Haskell the last few months (my project involves it). Mind you, Dr Sharp (the director of teaching in the CS dept, and incidentally also the lecturer for that module) says that kind of mark, close to a boundary, might get revised upwards. And anyway, it was a truly evil exam :)

Incidentally, the piece of paper I picked up from the office had a mark on it for Computer Graphics 2, which I didn’t take (wasn’t even enrolled for it), and it didn’t have a mark for Funky 2. It took me about half an hour to sort this out, but apparently there was a glitch with Dr Sharp’s mail merge which gave the wrong module code and title, though the mark and the actual records were correct. He eventually printed me a new piece of paper with the correct words on it.

On a totally unrelated note, I just remembered something I found out over the holiday: apparently Prof Thimbleby used to go to the same church as my cousins.

QOTD VIII

Wednesday, February 7th, 2007


Quoth Doaitse Swierstra, nevermore,
>  digest.chew.eat.serve.cook.chop.pluck.kill $ chicken
>
> we all have a definite feeling that after applying the functions, the
> original object is no longer available, and the FP view does not feel
> entirely natural.

Yes, that is true. I can sort of see why people might object to the IO
monad in this case, since it explicitly prevents the programmer from
reusing old data. Of course, one might argue that it's not really the
*monad* that prevents it, but the construction of the physical world.
The monad merely prevents us from trying to eat our cake and have it.


Dougal Stanton on haskell-cafe (archive).


For the uninitiated, the dots refer to function composition; in OO notation it would look like chicken.kill().pluck().chop().cook().serve().eat().chew().digest(). The point is that that kind of composition in Haskell implies there are no side effects. Consider:


let chicken = getChicken
in  (chicken,
    (digest.chew.eat.serve.cook.chop.pluck.kill) chicken)

Here we’ve taken a chicken, eaten it, and returned the result along with the original chicken — i.e, we eat our chicken and have it. This is what the IO monad stops you from doing, and why composing functions that perform side effects is difficult.


This is perhaps a good introduction to a rather interesting video I also saw linked from haskell-cafe (in fact in the same thread). It’s only available in WMV unfortunately (it does come from MS after all).