XREF: A Case Study
in Common Lisp Portability
Thomas Gruber
Department of Computer and Information Science
University of Massachusetts
Amherst, Massachusetts 01003
and
Artificial Intelligence Technology Group
Digital Equipment Corporation
77 Reed Road, HL02-3/E09
Hudson, Massachusetts 01749
I Introduction
Experience in building XREF, a COMMON LISP cross reference utility, has revealed several issues
relevant to writing portable program analysis utilities and supporting portable application
programs across implementations. XREF is a program analyzer that parses LISP code, analyzes
calls to macros and functions and the use of variables, and then produces reports on interdependencies
among functions, macros, variables, and files. It was designed to be a portable
COMMON LISP program that could analyze any program written entirely in COMMON
LISP; the standard specified in [1] (hereafter CLtL)
is both its implementation language and domain.
When XREF was implemented, however, some assumptions about the the organization of
portable COMMON LISP programs had to be made, and when XREF was ported to other
COMMON LISP implementations, more assumptions about what a portable program can expect
from an implementation were unearthed. The issues that gave rise to these assumptions
are relevant to building portable program analysis utilities ("code walkers"), such as compilers,
language-specific editors, translation tools, and documentation generators. They are also
important for writing portable COMMON LISP programs; while the text of CLtL can be vague
on these issues, the needs of a program analysis tool such as XREF forces them to be made
explicit.1
*****************
Copyright © 1987, Thomas Gruber
1
This paper takes no stand on whether any of these problems can or should be resolved for the Common Lisp
standard. Indeed, these issues have been discussed at length among contributors to the Common Lisp mail on
the ARPAnet. The intent here is to bring potential portability and implementation issues to the attention
of the wider Lisp community.
|