Skip to content

Paradigm Shift: Back to the Past, and No Small Talk About Smalltalk

August 25, 2009

Those who have been reading my posts may have noticed this trend, but there has been a decided shift in the nature of my posts starting on June 18, 2009.

Specifically, prior to this date, the majority of my posts focused on Haskell, Scheme, and category theory, with a focus on purely functional programming. While I am still interested in purely functional programming, one of my other major interests is in creating a three-dimensional virtual world with some innovative functionality (I have something specific in mind).

At first, I was intent on finding a way to create such a world using a purely functional programming language. However, most purely functional programming languages do not have enough libraries to enable easy creation of such a world. Furthermore, in order to create such a world, most purely functional programming languages would require a rather sophisticated knowledge of linear algebra, which is one area of mathematics that my visiting discrete mathematics professor in college did not adequately cover, and which I have never had enough time to study fully on my own; by contrast, my favorite areas of mathematics are all related to set theory, recursive function theory (a.k.a. “computability theory”), and philosophical logic.

Therefore, I began searching for a programming language which would enable feasible writing of a three-dimensional virtual world without requiring explicit knowledge of linear algebra. Furthermore, since I was interested in programming language theory, I wanted a programming language that was at least based on a general-purpose programming language, as opposed to a domain-specific language.

After an intermittent search that lasted several months, I eventually came across a tool called “Cobalt,” based on Croquet, further based on Squeak, a dialect of Smalltalk. Unfortunately, Smalltalk is a pure object-oriented language, not a functional programming language, and after repeated attempts at approaching Squeak, the basis for Cobalt, I found the GUI-based interface rather difficult to get used to, having come from an Emacs-based textual environment. In addition, having come from a functional programming background, I found the concept of object-oriented programming highly counter-intuitive. (Apparently, I’m not the only person who has experienced this problem; similar arguments have been advanced by Paul Hudak [1] and Jonathan A. Rees [2].)

In short, I was encountering a paradigm-shift problem (with apologies to Shriram Krishnamurthi, who claims [3] that paradigms are ill-defined and hence significantly meaningless).

Here, I was faced with a dilemma: If I tried using a functional programming language, I would probably need to do a lot of work in writing the necessary libraries for the three-dimensional manipulation of graphical objects, which would additionally require learning linear algebra, which, between my full-time translation job and my busy weekends, I simply did not have enough time to learn. On the other hand, if I tried using Squeak, then every time I tried to learn the language, I would feel uncomfortable with the object-oriented paradigm, and with the GUI-based environment, and keep returning to such familiar programming languages as Scheme and Haskell, and to such development environments as Emacs.

After some thought, I realized that the problem with learning Squeak did not have to do with any inherent difficulty in Squeak itself; rather, I needed, at least temporarily, to unlearn functional programming and unlearn working in Emacs. In short, I needed to restore a blank mental slate. Well, where did I first learn functional programming and Emacs? Ah, that’s right: in college.

Although I couldn’t actually un-attend college, I could, in a sense, restore my mental state to just before attending college: What I needed to do was to go back to the past, mentally speaking, to just before college, and approach Squeak with a fresh mind. To borrow Scheme terminology, I needed to resume the continuation in the process of my life from just before attending college: Then it would be straightforward.

One night, just after midnight on Thursday, June 18, 2009, I was walking back home, reminiscing: Let’s see … what was I doing back then. Going back in time …

2009,
2008,
2007 (changed jobs again, and became patent translator),
2006 (became patent checker, then changed jobs, and became software project leader),
2005,
2004 (moved from Manhattan to Tokyo),
2003,
2002 (political difficulties at work; job further downgraded to English teacher),
2001 (WTC disaster in Manhattan, where I lived; severe downsizing at workplace resulted; job downgraded to Materials Coordinator),
2000,
1999 (became Localization Coordinator at Berlitz),
1998,
1997 (first moved to Manhattan from New Rochelle, NY),
1996 (began first major job as Systems Engineer in White Plains; moved to New Rochelle from Jersey City),
1995 (first moved to Jersey City from New Haven),
1994 (graduated from college),
1993 (took courses in recursive function theory, philosophical logic, and the lambda calculus, especially enjoying the lambda calculus; first exposure to Haskell in auditing a course on Haskell),
1992 (finished leave of absence and self-study of discrete mathematics; took a course in axiomatic set theory),
1991 (began leave of absence and self-study of discrete mathematics),
1990 (took a course on Pascal and hated it; embarked on Computer Science major; started learning Common Lisp and Scheme: hated Common Lisp because of all the funcalls and idiosyncracies, but enjoyed Scheme because of the relative simplicity and regularity of structure of the language; started learning Emacs; learned how much I did not know, and how stupid I was, and became chronically depressed),
1989 (moved from Tokyo to New Haven, and matriculated at college).

1989. Ah, there: Continue from the continuation of my life-process at that point: the early afternoon of August 31, 1989, just before leaving for Narita Airport to go to New York to take the bus therefrom to New Haven to begin my (dreaded) college studies.

No Emacs. No Scheme. No Haskell. No category theory. No chronic depression. Return of math phobia. Return of Japanese popular music. Return of a simple mind which is not depressed because it does not know how much it does not know. Return of interest in multimedia. Aha!

Multimedia: the missing link! At that time, I was very interested in the Fujitsu FM Towns, a Japanese personal computer modeled on the Macintosh, the interface of which was based on Smalltalk [4]! Proceeding to Smalltalk from this continuation would be relatively trivial!

Sometimes, one needs to move backward in order to move forward.

So I decided to resume my continuation from this point on, with a fresh mind.

Resuming continuation….

I awoke, as if from a trance.

The next day, I returned to my computer, continuing the continuation. Suddenly, this strange text-based interface on my screen called “Emacs” seemed like a monstrosity that some text-based hacker must have concocted just for the sheer challenge of mastering arcane keystroke-combinations. Yuck! There must be a way to do programming without having to master arcane keystroke-combinations.

Let’s see; where can I find a point-click-drag interface that allows me to program without having to use a textual editor … preferably, one similar to the graphical user interface of the Fujitsu FM Towns, based on the user interface of the Macintosh….

Aha! what’s this mouse-face-icon on my desktop labelled “Squeak?” Double-clicking on the icon labelled “Squeak”….

Hmm … a colorful background with illustrations. Sound. Multimedia. Point. Click. Drag. How intuitive: just like the Macintosh interface! Hmm … some research shows that it is an implementation of a language called “Smalltalk,” the interface of which was the basis for the Macintosh … what a coincidence … how curious…. I wonder who put it here….

Hmm … found a note here. It says, “Note to myself: Learn Squeak and Cobalt, and build a virtual world using Cobalt, using ideas described on the attached sheet.” Sure; why not?

[1] Hudak, Paul. “[Haskell-cafe] a regressive view of support for imperative programming in Haskell.” Online posting. 8 Aug. 2007. 25 Aug. 2009. <news://gmane.comp.lang.haskell.cafe>. Also available at <http://www.haskell.org/pipermail/haskell-cafe/2007-August/030178.html>.

[2] Rees, Jonathan A. “JAR on Object-Oriented.” Online posting. 11 May 2003. 25 Aug. 2009. <http://mumble.net/~jar/articles/oo.html>.

[3] Krishnamurthi, Shriram. “Teaching Programming Languages in a Post-Linnaean Age”. Cambridge:_2008 SIGPLAN Workshop on Programming Language Curriculum_ (2008): 81-83. <http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-teach-pl-post-linnaean/paper.pdf>.

[4] Kay, Alan C. “The Early History of Smalltalk.” Cambridge, Massachusetts: _History of Programming Languages: The second ACM SIGPLAN conference on History of programming languages_ (1993): 69-95. <http://portal.acm.org/citation.cfm?id=154766.155364&coll=GUIDE&dl=GUIDE&CFID=45415434&CFTOKEN=84716013>. Also available at <http://gagne.homedns.org/~tgagne/contrib/EarlyHistoryST.html#29>.

12 Comments
  1. Congratulations on continue-ing your journey!

    It sounds fun. I look forward to updates.

    BTW your reverse chronological log was cracking me up, thanks for it.

    • Glad you liked it. Since nobody seemed to reply at first, I was beginning to feel concerned that I had perhaps alienated all of my readers with the paradigm shift; it’s nice to hear that that seems not to be so.

      (Actually, I’m still writing posts about functional programming when I switch back the continuation; I actually have more than two “topics” (to borrow the term for a collection of newsgroups by category used in the Gnus Manual, to which I am currently referring; I am considering using Gnus in the near future) of newsgroups and mailing lists in my newsreader, one of which is labelled “Preferred Mailing Lists and Newsgroups” (for the collection of such prior to June 18, 2009), and the other of which is labelled “Pre-College Benjamin L. Russell’s Mailing Lists and Newsgroups” (for the collection of such after that date). Primarily I read and write in the latter, only rarely referring to the former when I need to refer to some detail.)

  2. Blogs are naturally going to evolve over time; everything has an expiration date (doesn’t sound like you are excluding FP, but you get the point).

  3. Michael permalink

    Did you check out Clojure, a very cool LISP dialect for the the Java Virtual Machine that gives you access to all the Java libraries while still being able to code in a functional style? I guess there are cool 3D environments for Java available…

    • Yes, I have looked into Clojure, but it unfortunately does not support continuations. Since one of my main interests in Scheme is in continuations, if I were to use a functional programming language, it should, at minimum, support that feature.

      More specifically, according to Programming Languages: Application and Interpretation (by Shriram Krishnamurthi), Part VII: Continuations,

      The following is an uncontroversial property that we would expect of a travel reservation site:
      The user should receive a reservation at the hotel that was displayed on the page he submitted.

      However, because HTTP is a stateless protocol, without continuations, it is very difficult to maintain this property in Web-based transactions. Since I am interested in designing a virtual world with this property to support Web-based financial transactions (as a whole, the Web site should be a microcosm of the real world, with each virtual city being a microcosm of the real-world city it represents, both visually and functionally), lack of support for continuations is a critical flaw. At least Seaside supports continuations.

      Also, additional investigation into tools for creating virtual worlds has revealed that some such tools assume knowledge of linear algebra for coding the three-dimensional objects. However, my university professor who taught linear algebra was a visiting professor who only spent two weeks on the subject in a course on discrete mathematics for computer science, and partly as a result, my current facility with linear algebra is rather limited, and does not include knowledge of eigenvectors, eigenvalues, and determinants. One of my reasons for being interested in such tools as Squeak and Open Cobalt is that such tools typically do not assume facility with linear algebra for creating virtual worlds.

      My main issue with Squeak is that most of the discussion on the Squeak-related lists is almost devoid of topics related to programming language theory. This is simultaneously a disadvantage and an advantage. It is a disadvantage because any time I want to discuss such interesting topics as semantics or lambda calculus, it is difficult (if not impossible) to find any discussion of related topics in that language or related tools, since Squeak is not a functional programming language. However, it is also an advantage because the conceptual basis for Squeak is that of the biological interactions of selfish genes as in Richard Dawkins’s book, as opposed to that of mathematical functions, and hence, there is less assumption of familiarity with such areas as linear algebra.

      (For some reason, most books on linear algebra do not simultaneously combine the geometrical, functional, and algebraic viewpoints integrally into their analysis of a vector space, and hence, it is difficult to visualize algebraic operations on matrices in terms of their geometric counterparts. If you can recommend any books on linear algebra that combine these viewpoints integrally from a theoretical perspective for students with a background in axiomatic set theory and discrete mathematics, preferably in the flavor of the book Naive Set Theory, by Paul R. Halmos, please let me know.)

      Can you suggest any functional tools for creating virtual worlds which simultaneously support continuations (preferably first-class Scheme-style continuations) and which do not assume knowledge of eigenvectors, eigenvalues, or determinants in linear algebra?

      • Michael permalink

        Regarding Clojure & Continuations:
        Clojure has something but I can’t comment on how good that is.
        See http://stackoverflow.com/questions/1173133/continuations-in-clojure

        Regarding your question on tools:
        I have heard very good things of http://unity3d.com/unity/ which can be scripted in Javascript (which might have continuations). I guess it is pretty easy to build virtual worlds with it (graphical editors…) because it was made for that. I also guess that it does not require a mathematics degree to do that. But I have never used it.

        Good luck with your project.

        • By “Scheme-style continuations,” I had meant “first-class continuations,” in which the state of execution of the program can be saved at any point in the program and returned to at a later point. Actually, I just came across “The Continuation Monad in Clojure,” which is “a work around for the fact the clojure doesn’t have continuations built in,” designed by Intensive Systems Consulting, Inc. This looks promising, but requires some investigation.

          Unity looks interesting, but I have one pet peeve with the “Tropical Paradise” live demo: The clouds do not move. Is this a built-in feature of the engine, or is it possible to customize the engine so that the clouds do move? In the virtual world that I am planning, I would like the clouds to move. In Open Croquet, for example, the clouds actually move in the demo. Moving clouds add an important immersive factor to the virtual environment.

          One other tool that I also investigated, but decided against because of a compatibility issue, was Open Wonderland (previously “Project Wonderland”). Unfortunately, the current Version 0.5 User Preview 4 (2010-0_5_A4) requires the Java SE 6 JDK for Mac OS X, which only runs on the recent 64-bit Intel-based systems; since mine is a PowerPC G4-based system, it won’t run. Also, in the Wonderland video “YouTube – Running Project Wonderland client inside Project Wonderland,” the clouds don’t move, and again I am concerned about whether this is an integral issue with the engine itself, or can be overcome easily. If the clouds don’t move in a demo video designed to showcase the capabilities of the engine, they probably don’t move by default in the engine itself, and it is not clear whether this problem can be overcome easily. I don’t mind sacrificing some speed for a more immersive environment with moving clouds.

          (Personally, in my private recreation time, one reason that I prefer the environment of the MMORPG “Final Fantasy XI Online” to that of “World of Warcraft” (which I have never played) is that the former has moving clouds, while the latter apparently doesn’t. I want to live in the virtual world, not just explore it, and one thing I like to be able to do when living in Vana’diel is to sit down, relax, munch on a Rolanberry Pie, sip a Yagudo Drink, and just gaze at the sky. If the clouds don’t move in my world (whether real or virtual), then I don’t feel that I (as the spirit of my avatar, as opposed to the avatar as a representation of the RL incarnation of me) am actually there. It just doesn’t feel right.)

Trackbacks & Pingbacks

  1. Paradigm Shift: Back to the Past, and No Small Talk About Smalltalk « Virtually Squeaking: Adventures in Squeak, Croquet, and Open Cobalt
  2. Virtually Un-Squeaking: The Paradoxical Link Between Exploring Virtual Worlds, but Studying Haskell Instead of Squeak « Monadically Speaking: Adventures in PLT Wonderland
  3. Virtually Un-Squeaking: The Paradoxical Link Between Exploring Virtual Worlds, But Studying Haskell and Scheme Instead of Squeak « Monadically Speaking: Adventures in PLT Wonderland
  4. Evolving Flying Fish, Running Birds, and Swimming Lizards: Resolving Paradigm Shifts « Monadically Speaking: Adventures in Programming Language Theory
  5. Evolving Flying Fish, Running Birds, and Swimming Lizards: Resolving Paradigm Shifts | Monadically Speaking: Adventures in Programming Language Theory

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: