Happy Thanksgiving, Alice

I have a queue of about a dozen posts I thought I would get to the day after Thanksgiving. Instead, I followed the ‘Clarion Beauty Computer’ down a rabbit hold and have only just emerged. More about that machine later. There’s only really one post that needs to go out today.
Alice Brock, of Alice’s Restaurant fame, passed away a week before Thanksgiving. Arlo Guthrie’s 1968 anti-war anthem about a Thanksgiving meal and its repercussions has been a staple of Thanksgiving in American families since before the end of the Vietnam-era draft in ‘73. By all accounts, Alice tolerated but did not welcome her 15 minutes of fame. On the LP version, fame runs to 18 minutes and 34. Guthrie’s refrain “You can get anything you want at Alice’s Restaurant, excepting Alice” was not far from the mark.
I was born after the end of the draft and encountered this Thanksgiving tradition really without its intended context. In the song, Alice and husband Ray are said to live in the bell tower of a deconsecrated church in Stockbridge, Massachusetts. Arlo and a friend proceed to haul a large quantity of garbage from the sanctuary of the church to the town dump on Thanksgiving. Finding the dump closed, they illegally deposit the garbage in the wilderness. An arrest for littering becomes the basis, later, for a potential moral waiver for the draft and a wandering exploration of the morality of the Vietnam War.
I always thought of it as a song about two important topics in computing — storage management and exception handling. If you have a large sanctuary, you don’t have to take out the garbage for a long time. I admired this approach. What if we could solve the problems associated with garbage-collected storage management systems simply by …. not collecting the garbage for a long time? Likewise, what’s the point of preparing to catch exceptions within processes built on assumptions more faulty than the bug being caught.
Whether you’re pro-littering or not, pro-Vietnam or not, or pro-computing or not, the song is surely about having a Thanksgiving dinner that couldn’t be beat no matter what was happening in the wider world.
Anyway, if there were a computing architecture inspired by the song Alice’s Restaurant, the first opcode to define would probably be “ALICE”. I think ALICE probably act as HALT on other machines. After all, you can get anything you want in Alice’s Restaurant, excepting Alice. Next would come FEED <n>, which would create enough spaces at a virtual table for hungry diners (in the manner of the brk() system call), then SET, which would move an item from a cupboard or virtual table down at another table. With the table set, CALL brings guests (like add, cos, if, fft) from the living room in to sit down. Finally, FORK allows a guest to start their own conversation at the table (a thread, really)
That’s it. Once you embrace the idea that things like memory management and floating point are not core features in an architecture, it’s easy to see basic arithmetic and branching as no different. If you want those things in an implementation of Alice’s Restaurant, it’s up to you to invite them.
This sounds ridiculous, but I use a version of this architecture every day. In my version, FEED produces storage on a virtual tape that is Write-once, Read-many which cannot be read by programs before it is written. Any read to an unwritten piece of tape simply blocks until the tape is written. This makes thread synchronization, tracing, and debugging quite easy. It also means that foreign function interfacing is easy. Foreign calls return, if they return, by writing to a spot on the tape designated for their return value. Any program waiting for the value simply blocks until it’s available. The real work of the CPU is scheduling what could be a very large number of threads.
Computing this way uses a lot of tape but virtual tape is cheap. The Scheme programming language, in its 5th revision, was defined as an ‘unlimited extent’ language, not a garbage collected one. An implementation could reclaim storage in cases where no reference existed — but it never required it. For many of my own programs, I found that I could get an inexpensive speedup by adding more memory to the system and running the program without collection. In the Alice scenario, if you can defer taking the garbage out until the church is demolished then you simply win.
Is this model ever not wasteful? That is what interests me the most. If the energy required to make and install a new bit of memory ever passes below the energy required to re-write a bit … then no! I think a more likely scenario is one-time memory use over the length of a program and bulk thermal erase from waste heat in the system afterwards.
Happy Thanksgiving from the team at Paper Tiger.