RIP John McCarthy

What a sad month for those of us who program computers.

Take a moment to reflect on this paper, published in April 1960:

No provision need be made for the user to program the return of registers to the free-storage list.

This return takes place automatically, approximately as follows (it is necessary to give a simplified description of this process in this report): There is a fixed set of base registers in the program which contains the locations of list structures that are accessible to the program. Of course, because list structures branch, an arbitrary number of registers may be involved. Each register that is accessible to the program is accessible because it can be reached from one or more of the base registers by a chain of car and cdr operations. When the contents of a base register are changed, it may happen that the register to which the base register formerly pointed cannot be reached by a car - cdr chain from any base register. Such a register may be considered abandoned by the program because its contents can no longer be found by any possible program; hence its contents are no longer of interest, and so we would like to have it back on the free-storage list. This comes about in the following way.

Nothing happens until the program runs out of free storage. When a free register is wanted, and there is none left on the free-storage list, a reclamation cycle starts.

First, the program finds all registers accessible from the base registers and makes their signs negative. This is accomplished by starting from each of the base registers and changing the sign of every register that can be reached from it by a car - cdr chain. If the program encounters a register in this process which already has a negative sign, it assumes that this register has already been reached.

After all of the accessible registers have had their signs changed, the program goes through the area of memory reserved for the storage of list structures and puts all the registers whose signs were not changed in the previous step back on the free-storage list, and makes the signs of the accessible registers positive again.

This process, because it is entirely automatic, is more convenient for the programmer than a system in which he has to keep track of and erase unwanted lists. Its efficiency depends upon not coming close to exhausting the available memory with accessible lists. This is because the reclamation process requires several seconds to execute, and therefore must result in the addition of at least several thousand registers to the free-storage list if the program is not to spend most of its time in reclamation.

This was on a computer with single digit kilobytes of memory, in a world where high level languages were still an unproven, experimental idea.  Yet to this day, much of what we consider 'new' in mainstream programming languages (C# 3.0, anyone?) boils down to pieces of Lisp wrapped up with a more friendly syntax!

A great man, truly ahead of his time, whose work benefited us all.

Comments (3)

  1. Andy says:

    What a (clever) load of garbage 🙂

  2. Gull says:

    The generation of fathers of computers is going down little by little.

  3. Vlad says:

    It's hard to believe that we live in their far far future. Such a giant leap of technology – from 1960 to 2012! I even didn't try to code on lisp, now even c++ looks like an anachronism… Different thoughts and feelings.

    Rip and thanks for all the fish anyway!

Skip to main content