The SECD machine is an influential virtual machine and abstract machine intended as a target for compilers of functional programming languages. The letters stand for <code>stack</code>, <code>environment</code>, <code>control</code>, <code>dump</code>, respectively, which are the internal registers of the machine. The registers <code>stack</code>, <code>control</code>, and <code>dump</code> point to (some realizations of) stacks, and <code>environment</code> points to (some realization of) an associative array.

The machine was the first to be specifically designed to evaluate lambda calculus expressions. It was originally described by Peter Landin in "The Mechanical Evaluation of Expressions" in 1964. The description published by Landin was fairly abstract, and left many implementation choices open (like an operational semantics).

Lispkit Lisp was a compiler based on the SECD machine, and the SECD machine has been used as the target for other systems such as Lisp/370. In 1989, researchers at the University of Calgary worked on a hardware implementation of the machine, with the same rationale as a high-level language computer architecture related to a Lisp machine.

Landin's contribution

D. A. Turner (2012) points out that the ALGOL 60 programming language could not return functions from other functions (rendering functions no longer first-class). A function nested inside another function could refer to a variable living on the outer function's stack. If the nested function were returned from the outer function, then it would be referring to a variable in a stack frame that is no longer present. Turner notes that Landin's SECD machine solves this problem (thus allowing functions to return functions), as a function value is now represented with a closure on the heap that can store the environment of variables it should use irrespective of what happens on the stack.