Rabbit: A Compiler for Scheme/Chapter 11

From Wikisource
Jump to navigation Jump to search


[Page 98]

88 11. Comparison with Other Work The only other work we know of similar to ours is that in [wand and Friedman]. They use a technique from category theory known as factorization to isolate trivial expressions. As far as they go, their work is similar to ours; they have written a compiler for LISP code, producing output code which uses continuations. However, they indicate that they cannot interface compiled and interpreted code correctly. Moreover, while they use continuations, they do not make general use of closures, and in fact there is no clue that closures are permitted in their source language, or that functions are permissible as data objects. (In fact, there is evidence to the contrary in several examples they give involving an expression (NAPCAR (QUOTE (LAMBDA . . . )) . . .) These seem to indicate that they have not made the crucial distinction between treating a function as a data object and treating a representation of a function as data.) wand and Friedman do realize the importance of tail-recursion, but fail to mention the necessity for lexical scoping (perhaps taking it for granted). We feel that the contributions of category theory may provide interesting new ways to analyze programs, but also feel that Wand and Friedman have not, in the work cited, explored it thoroughly, since they have not even explored the issue of closures as such.

Somewhat more distantly related is the work of Carter and others at the IBM T.J. watson Research Lab. [Carter] This work is similar in spirit, in that it uses "macro definitions" of complex operators, which are integrated into the program being compiled, followed by source-to-source program transformations which optimize the resulting code. However, they have primarily worked with

[Page 99]

B9 definitions of complex data manipulations, such as string concatenation, whereas this report has dealt exclusively with environment and control operations.

(Also, as a matter of taste, we find SCHEME a simpler and more tractable language to deal with than the low-level dialect of PL/1 used in [Carter], partly because of its closeness to lambda-calculus and partly because SCHEME inherits from LISP the natural ability to deal with representations of its own programs.)