The G-machine is an abstract architecture for evaluating functional-language programs by programmed graph reduction. Unlike combinator reduction, in which control is derived dynamically from the expression graph itself, control in programmed graph reduction is specified by a sequence of instructions derived by compiling an applicative expression.The G-machine architecture was defined by Thomas Johnsson and Lennart Augustsson (Gothenburg) as the evaluation model for a compiler for a dialect of NIL with lazy evaluation rules. This paper describes a sequential evaluator based upon that abstract architecture. It discusses performance issues affecting reduction architectures, then describes the organization of a hardware design to address these issues. The interplay between compilation strategies and the computational engine is exploited in this design.Principal features of the design are (i) hardware support for graph traversal, (ii) a vertically microcoded, pipelined internal architecture, (iii) an instruction fetch and translation unit with very low latency, and (iv) a new memory architecture, one specifically suited to graph reduction and which can be extended to very large memories.
Reduction systemsA reduction architecture evaluates an expression by transforming it through a series of intermediate forms until it cannot be further transformed, under a set of rewrite rules. The expression is then said to be in normal form, which is the value attributed to the original expression.To be deemed useful for evaluating functional-language programs, a reduction system must be consistent with the mathematical semantics of applicative expressions. It should also have the Church-Rosser property, which assures the uniqueness of a normal form independent of the particular reduction sequence by which it is produced. These, however, are the only constraints placed upon reduction systems, and a great variety of elegant and imaginative schemes are possible.Church's lambda-calculus and Curry's combinatory calculus are the best known examples of reduction systems, and have served as abstract models for experimental computing engines [Ber75, Cla80, SCN84, Sch85]. There are other systems as well. A string-reduction system implementing the semantics of Backus' metalanguage FFP has been used as the basis for an architecture allowing massive parallelism [Mag79]. String reduction is essentially like combinator reduction except that the value of an expression is not shared among multiple references; the expression is multiply evaluated.Architectures based upon ¢?-reduction (lambda-calculus), combinator reduction, or string reduction all have in common the property that control --the selection of the next reduction step --is dynamically derived from the current expression form at each stage in a reduction sequence. We call systems with this property pure reduction systems.