What brought me to Haskell
I have been reading Paul Graham’s essays for a while as I am interested in Startups. The enjoyment derived from his essays led me to purchase his book: “Hackers & Painters.” Intriguing title, isn’t it? He connects the two seemingly disjoint domains by pointing out that people who succeed in both start by sketching out their solution/artwork. He also argues that there are certain mediums which are better suited to sketching and building iterations on top of the sketch compared to other available mediums. Imagine Oil Colours in case of painting / Python in case of programming. He also identifies other such features that make a medium, in the case of programming - a language, superior to other contenders.
He identifies Lisp as the language that fits the bill (at least in the late 90s and early 2000s) and goes on to demonstrate that this language from the 60s had features which were later adopted by the popular programming languages, even today. (Personally, I find the experience of using REPL in Lisp quite similar to the Python Interpreter, which did not exist till the 90s). So after all this pep talk ruminating in my brain during periods of reading snippets from the book on my iPhone’s kindle app, I thought of exploring programming in Lisp. And somehow, (I can’t remember anymore, perhaps I asked Perplexity) I ended up at Practical Common Lisp (free online book).
The most engaging aspect of Practical Common Lisp is that it hits the ground running. By chapter two, you already have Portacle or some other IDE of choice on your device and you are messing around with REPL - the Read-Evaluate-Print Loop. So the book too maintains the ‘sketchability’ ethos of lisp. In the later chapters, it goes on to explain the concepts already used by you in writing programs in Chapters 2 & 3 - Syntax, Semantics, Functions, Variables etc. After reading about 6/7 odd chapters, I was curious about what I could do with this cool new language. What are the possibilities? Of course, I could try to implement a few personal project ideas in Lisp instead of Python/FastAPI but I would have to start with smaller blocks first. And I also wanted to work on tiny snippets of programs where I get a taste of Lisp-iness of Lisp. Not just implement something that can be done in any other programming language.
Since my Lisp IDE used Emacs as the text editor, it led me to think of reaching out to my Prof. from undergrad. Let’s call him AM. He had never taught me (as I was in Electrical Engineering and he taught CSE folks) but I always thought of him as a pretty cool person, and a hacker to look up to. I had participated in a game building hackathon in my first year at college, and we built a text based command line game. AM was the force behind the theme of this contest, and he reminisced about his days roaming online Multi-User Dungeons (MUDs) (perhaps a precursor to modern RPGs/Sandboxed games) and shared his credentials for us to get a taste of the experience (See this video to get what I’m talking about: SDFmud on YouTube). A relic of a bygone era when people used to connect to a remote server from their terminal and used to play text based games, a bit like Give Yourself Goosebumps - You Choose the Scare books by R.L. Stine (these category of books, called Gamebooks, are of the few places in Fiction where you can see Second Person narrative as opposed to First/Third Person).
I had heard from a few friends in CSE that AM was a proponent of Emacs as a text editor. Back then, I was obsessed with Vim (I still have Vim extensions enabled on VS code - both on my personal Mac and work HP), so I made a mental note that I would reach out to him whenever I switch to Emacs (as figuring out Vim was like getting blindsided by a train and exiting Vim, for a noob, is like trying to escape a labyrinth, so I assumed the same for emacs). Back in the present, I texted him to see if he can give me few pointers on how to go about emacs and asked him which text editor he uses these days. The answer surprised me - Vim and LaTeX. Vim - he was a kindred soul! LaTeX - not so surprising for a Prof, especially in CSE. I also told him that I was learning Lisp and wondered what cool things I could do with it. His response was commanding - Don’t learn Lisp, learn Haskell (At this point one should note that AM’s university G-suite account had a display picture of Haskell’s logo). He also sent a research paper on why Haskell-like languages are preferable over Scheme-like languages. (For what? I assumed - Proving Stuff in Theoretical Computer Science, as opposed to Paul Graham’s building stuff in say, startups). I couldn’t make head or tail of the Research Paper but I chose to put my faith in my Teacher (I am also obsessed with Gurukula system and Guru-Shishya dialogues heard in Ancient Indian Spirituality and also Zen/Sufi stories).
(You have to take a leap of faith in these things. Once you reach a certain level of knowledge in the context, you can judge for yourself. Also, sometimes one’s questions as a beginner are dumb. In fact, all questions are dumb. Hence the need to ask them. The paradigm in which the questions arise are often wrong, and hence the confusion leading to the question. The question is often answered by a new paradigm that better approximates the truth, hence why answers to genuine questions (or doubts) seldom look like the questions themselves. In fact I postulate that all the answers which are framed similar to the questions occur only in Textbooks or Exams. Genuine doubts often go beyond these textbook questions. And are sometimes too dumb or naive or unthinkable for authors of these textbooks.)
So AM recommended a textbook - Graham Hutton’s Programming in Haskell and I’m reading one chapter a week, learning through exercises, and connecting weekly to discuss the progress.