The SECD machine was described by Peter Landin in a paper written in 1964. The original paper isn't that easy to read and a lot of people, me included, prefer Peter Henderson's description found in a 1980 technical report from Newcastle University Computer Laboratory.

This leads to a big so what?. Why care about yet another description of a computer? Especially one as old as this!

The answer is because the SECD machine was one of the earliest descriptions of an abstract machine. Clearly not the earliest abstract machine, that honor more likely belongs to Alan Turing for his description of the Turing Machine. Since then, of course, there is the Java Virtual Machine (JVM) which is widely implemented.

The reason the SECD machine is important, though, is that its design makes it a practical intermediary between a high-level programming language and the details of any given computer. It's instruction set is more expressive than that of the Turing Machine and far less complicated than that of the JVM. As such, if performance isn't your main goal, the SECD machine makes an ideal abstract machine for which compilers in a wide variety of languages may be written.

Here's where it gets interesting. The SECD machine is just 4 registers: Stack, Environment, Control, and Dump (from which the machine gets its name); Each of these registers is an S-expression. When it is started, the S, E, and D registers are empty S-expressions and the C register is an S-expression that defines the instructions to be executed. Each instruction defines how the S, E, C, and D registers are transformed by the execution of the instruction at the head of the C register.

Because there are only 21 different instructions, the behavior of the SECD machine is easily understood. It's also easy enough to implement. Peter Henderson's description of the SECD machine makes reference to an implementation in Algol W. Since then, I've seen an implementation written in Java. There's a strange irony to the Java implementation as we see a computer program that interprets an abstract machine where that program is compiled into object code that's executed by another abstract machine (the JVM).

So there it is, an old idea that's surely underused, and yet the SECD machine is a truly powerful design that is well worth looking into.

Log in or register to write something here or to contact authors.