Virtually Un-Squeaking: The Paradoxical Link Between Exploring Virtual Worlds, But Studying Haskell and Scheme Instead of Squeak
For the past year and a half or so, I have, on and off, attempted to study Squeak in order to learn how to write in Open Cobalt for the eventual purpose of writing my own virtual world, but for some reason, every time that I start to learn Squeak, I have felt vaguely uncomfortable in working in an object-oriented world, and have soon returned to the functional worlds of Haskell and Scheme.
At first, I thought that the reason had to do with my exposure to the functional programming paradigm, and even once made a paradigm shift. However, despite the paradigm shift, I still gradually returned to Haskell and Scheme.
Just now, after watching part of a talk by Rich Hickey, entitled “Clojure for Lisp Programmers Part 1,” I think that I may have discovered at least part of the real reason for this vague preference. During the talk (from 0:18:47 to 0:18:51 on the video), Hickey offhandedly mentioned, “I’m sort of a Common Lisp guy. I’m not a Scheme guy.”
This comment started me on a train of thought about what I felt about the differences in the styles of programming in Common Lisp vs. Scheme, and how these related to the differences between Clojure and Haskell, and eventually to the differences between Squeak and Haskell as well.
Granted, Common Lisp and Scheme have many similarities: They both use S-expressions in their syntax. They are both based on Alonzo Church‘s lambda calculus. They are both ultimately descended from the Lisp programming language invented by John McCarthy in 1958 at MIT. They are both dynamically typed. In addition, they both use lexical scoping for variables.
However, Common Lisp and Scheme are significantly different dialects of Lisp. Firstly, Scheme is a Lisp-1 dialect, whereas Common Lisp is a Lisp-2 dialect. (The difference between the two is that Lisp-1 dialects share a single namespace for functions and values, whereas Lisp-2 dialects have different namespaces for the two. For a technical explanation of this difference, see the paper “Technical Issues of Separation in Function Cells and Value Cells,” by Richard P. Gabriel and Kent M. Pitman, which appeared in the journal Lisp and Symbolic Computation, Volume 1, No. 1, June 1988, on pages 81-101.) Secondly, Scheme supports tail call optimization and first-class continuations and places a relatively heavy emphasis on recursion, whereas Common Lisp supports more special-purpose iterative looping constructs and has more standard common libraries. However, Common Lisp has no way of evolving, whereas Scheme has an RnRS (“Revised^n Report on [the Algorithmic Language] Scheme”) standardization process.
In particular, the emphasis on special-purpose constructs and standard libraries has a tendency to give many books on Common Lisp a more practical flavor, whereas the emphasis on tail call optimization, continuations, and recursion tends to give many texts on Scheme a more academic or theoretical flavor.
One of my mathematics professors in college once said, “Mathematicians don’t care about the real world.” Aside from whether this is true or not, this statement was actually one of my main reasons for switching from disliking mathematics to enjoying it: I myself don’t really care about the real world. When in college, I enjoyed studying algorithms, programming language theory, haiku poetry, and epic poetry, but disliked economics and social sciences. In my spare time, I enjoyed virtual reality environments, fantasy, and science fiction, but disliked business and generally anything related to monotonous social interaction or money. In short, unless a topic was related to some kind of theory, fantasy, or hypothesis, I wasn’t very interested.
This goes back to Haskell vs. Clojure. Being more of a writer than a programmer, I tend to enjoy discussion about programming language theory. While I have participated on both the Clojure Google group and the Haskell-Cafe mailing list, I have noticed that the latter has a much higher proportion of discussion focusing on relatively theoretical topics, such as semantics and category theory. I think that this, rather than differences between the languages per se, is one of the main reasons that I subconsciously prefer discussing Haskell to discussing Clojure.
This, in turn, goes back to Haskell vs. Squeak. Paradoxically, although it is the combination of my interest in experiencing virtual reality environments and the role of Squeak as the basis of such virtual reality development tools as Croquet and Open Cobalt that first brought me to Squeak, it is precisely my interest in the theoretical and fictional which also turns me away from Squeak and toward Haskell. Most of the discussions on the squeak-dev mailing list tend to be of a practical nature, concerning specific issues with using Squeak. However, I tend to be turned off by relatively mundane discussions. I’d much rather discuss, say, the philosophical basis of Squeak in Richard Dawkins‘ The Selfish Gene than, say, how to get Squeak to output sound. However, such discussions are relatively few and far between in Squeak discussion-land.
On the Haskell-Cafe, however, it is very common to read discussions about why, say, monads are like burritos. Such discussions remind me of finding the result of (cons ‘peanut ‘(butter and jelly)) on page 7 of The Little Schemer. It is common to find discussions of food related to programming language constructs in documents on both Haskell and Scheme. (Virtual) food is fun. Programming by itself can become monotonous after a while, but programming about food helps keep the doldrums away.
Speaking about (virtual) food, time to get a Rolanberry Pie for my avatar. Now if only my avatar could then program in virtual Haskell or virtual Scheme about virtual monad-burritoes and virtual ‘(peanut butter and jelly)….