Design of Everyday Parentheses June 15th, 2009
Patrick Stein

This weekend, I was reading The Design of Everyday Things by Donald Norman. At one point, he is talking about automatic behaviours:

Doing several things at once is essential even in carrying out a single task. To play the piano, we must move the fingers properly over the keyboard while reading the music, manipulating the pedals and listening to the resulting sounds. But to play the piano well we should do these things automatically. Our conscious attention should be focused on the higher levels of the music, on style, and on phrasing. So it is with every skill. The low-level, physical movements should be controlled subconsciously.

[Wow. In typing that paragraph out, I see all sorts of parallels to math, volleyball, cooking, and pretty much every other area of my life. But, for this essay, I’m just going to focus on what brought me here.]

People who are new to Lisp often end up complaining The parentheses. Man, too much with the parentheses. It’s an understandable complaint, but it’s just like complaining There are too many keys on this piano. It is a complaint that will go away after a small amount of practice.

Here is one sample from many, many similar threads in the Usenet news group comp.lang.lisp:

Ken Tilton wrote:
    Bill Dubuque wrote:
        Leo Sarasua wrote:
        Let's face it: all the ((((... and )))) in Lisp are awfully unreadable.
    Seasoned Lisp programmers see past parentheses just as a seasoned
    reader of a printed language sees past the individual characters
    comprising a word.
Parentheses? What parentheses? <g> Like you say, I stopped seeing them
after about a week of serious Lisp.
...
My retort to "what about all those parentheses?" is "do spaces between
words bother you?". <g>

The parenthesis are an unconscious action. They are part of the flow, not an interruption in it. Looking back on the programming classes that I took in high school and college, most everything was at the this is the next piano key level. Part of that is out of necessity. You have to learn where your feet are before you learn to walk or to run or to dance. [And, in a classroom setting, thirty people have to learn where their feet are before any of you can move on.] But, part of it is just tragic omission.

Teachers should share some glimpses of the future: the higher levels of the music, on style, and on phrasing. Teachers should talk about how some day, you’ll no longer be tripping over the parentheses. You will be dancing with them, complex dances, with grace and power.

Live coding demos? If you watch someone skilled at programming doing it, you see that this stuff doesn’t get in the way. With practice, the syntax becomes unconscious and automatic. So, I leave you with some live coding demos. The first is Andrew Sorensen performing with the scheme package Impromptu.

Day of the Triffords from Andrew Sorensen on Vimeo.

The second is Sven Van Caekenberghe implementing a Reddit clone in Lisp in twenty minutes:

Why You Should Get A Coding Cap June 5th, 2009
Patrick Stein

Way back when I was at Computer Science House I discovered coding caps. We were working on a Virtual Reality project (I told you it was way back, right?). While we were working, a company called Virtuality made a stop at R.I.T. as part of a larger tour of campuses showing off their VR game.

Guess Jeans was one of the sponsors of their tour. All of us working on the VR project ended up with black baseball-ish caps that said Guess across the front. We wore those caps all of the time we were coding.

Lately, I’ve been having trouble focusing on coding when I am gifted with some moments to spare. I thought, How about I get a coding cap? I tried this about a year ago when I was having similar trouble. The cap didn’t really work then. The cap would itch after a few hours, and before that, I would forget I was wearing it. Once you start reading email and answering the phone in your coding cap, it loses its power.

So, today, I set out looking for a new coding cap… one that I could wear for a few hours, but one that I would notice I was wearing. I tried on a few hats. None of them felt powerful enough. They didn’t have the coding cap magic.

I grabbed a pair of lace-up, fishnet, fingerless gloves. I plan to leave one by my keyboard and the other in my purse. When it’s coding time, I’ll slip one on.

So far, they seem to work. When I reach to check email, I immediately notice my glove and stop. When the phone rings, I peek at the caller-id and decide whether it’s worth it to remove the glove. Sorry, Out of Area: I’m coding right now, and I don’t want to have to take off my glove to hear about the great things you can do for my windshield/interest-rates/auto-warranty/credit-card-processing.

Do you have a coding cap? specific lighting? specific music?

Installing mpich2 for use with CL-MPI June 5th, 2009
Patrick Stein

Some time back, I began writing some OpenMPI wrappers for Lisp. I got everything that I needed working, but I hardly scratched the surface of what MPI-2 makes available.

Recently, Alex Fukunaga started up a blog about Lisp. One of the things he has done is make CFFI bindings for mpich2. Here is an introductory post about those bindings with a link to his CL-MPI site.

Today, I have been working on getting his bindings up and running under Ubuntu Linux and Mac OS X.

Read the rest of this entry ⇒

Emacs + Slime + SBCL on Windows Vista May 27th, 2009
Patrick Stein

I just finished setting up Windows Vista to run in VMWare Fusion. Then, I finally tackled setting up Emacs with Slime and SBCL under Windows Vista.

For the most part, I followed Robert Zubek’s gameplan. However, I quickly ran into a problem with swank’s temporary files not being in a writable location. I wish I had found this thread sooner. Alas, I ended up rolling my own by tweaking the temp-file-name function in swank-sbcl.lisp. The new version looks like this:

(defun temp-file-name ()
    "Return a temporary file name to compile strings into."
  #-win32 (concatenate 'string (tmpnam nil) ".lisp")
  #+win32 (concatenate 'string
                       (sb-ext:posix-getenv "TEMP")
                       "/"
                       (symbol-name (gensym "SL"))
                       ".lisp"))

Developing Lisp in Ubuntu Linux with VMWare Fusion May 27th, 2009
Patrick Stein

I am working on some lisp software that I would like to run under Linux, MacOSX, and Windows.

I have a PC that I can boot into either Ubuntu Linux or Windows Vista. Of course, I have a variety of services running under Ubuntu Linux on that box that the rest of my network would rather have around. As such, I would rather never boot that machine into Windows. So, I thought I’d give VMWare Fusion a try.

Actually, I thought I would try both VMWare Fusion and Parallels. Alas, Parallels lets me get my virtual machine set up, but will not let me run it without a license. VMWare Fusion lets me play for 30 days before buying a license. From what I’m seeing from VMWare Fusion’s performance, I can’t imagine dropping $80 on Parallels just to see if its virtual machine can outperform what I’m seeing from Fusion.

Right now, I am in the process of moving over the PC’s Windows stuff to my laptop so I can try running Vista through Fusion. While I was waiting for that, however, I installed Ubuntu under Fusion, updated a ton of packages, installed emacs, sbcl, slime, etc.

For comparison, I took some lisp code that runs in just under 11 seconds on my laptop. I ran the same code under Ubuntu in Fusion on the same laptop. It ran in just under 12 seconds. Some of that may also be that I am using an older version of SBCL under Ubuntu than I am native.

I have some more testing to do to make sure that cl-opengl will perform as well. But, I am quite pleased.

l