An Unsweetened Memory
For some reason, a memory returned to me today of how I would write Haskell when I first learned it, in 2007 or so. I was just getting into programming and more interesting languages in particular, having started with Turbo Pascal in high school, then getting into Lisps and the like. Scheme was the language that I really found rapport with, but I wanted to learn as many different sorts of language as I could, so at some point I tried out Haskell.
I’d become a sort of snob for functional languages at this point, being an annoying teenager as I was and keen to find distinction.
This snobbery went so far that when I read about how Haskell’s do
notation was a way to pretend to have imperative semantics, I disdained it and refused to use it.
That is, instead of writing code like this:
foo a = do b <- something a whatever b c <- andfinally a b
I would instead choose to write something this:
-- it's been a long time since I wrote Haskell, probably something like this foo a = something a >>= \b -> whatever b >>> \ -> andfinally a b
Cumbersome virtue-signalling for no-one but myself.
I didn’t spend too much time with Haskell; maybe that self-imposed abstention from syntax sugar made it too hard for me, but I think that strongly typed languages just aren’t for me.
However, one thing that did occur to me on recent recollection is that on subsequent encounters with “syntax sugar”, I found it very clear what the trade-off was and could very easily see the transformation that was happening.
Implementing domonad
in Clojure, with
in Elixir, async
/ await
in JavaScript; the transformation that was happening was so apparently to me that I would sometimes have trouble teaching about the await
syntax in JavaScript, because that transformation that was so self-evident to my eyes very much was not to my students.
This is just a memory that surfaced that I thought a little bit about with the benefit of almost twenty years of hindsight and has no real significance to anything. However, I do have to wonder if being free to write code in my own idiosyncratic way might have aided my growth as a programmer; if I had started in the era of everything being public on github, would I have been comfortable doing so? If I started now, with all my code written by LLMs in their bland grey style, would I think about the trade-offs notation as much? No way to know, but I wonder.