1
0
Fork 0
cl-sites/www.cs.cmu.edu/Groups/AI/html/cltl/clm/node6.html

178 lines
8.8 KiB
HTML
Raw Normal View History

2023-10-25 11:23:21 +02:00
<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
<!Converted with LaTeX2HTML 0.6.5 (Tue Nov 15 1994) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
<HEAD>
<TITLE>1.1. Purpose</TITLE>
</HEAD>
<BODY>
<meta name="description" value=" Purpose">
<meta name="keywords" value="clm">
<meta name="resource-type" value="document">
<meta name="distribution" value="global">
<P>
<b>Common Lisp the Language, 2nd Edition</b>
<BR> <HR><A NAME=tex2html1555 HREF="node7.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html1553 HREF="node5.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html1547 HREF="node5.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html1557 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html1558 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html1556 HREF="node7.html"> Notational Conventions</A>
<B>Up:</B> <A NAME=tex2html1554 HREF="node5.html"> Introduction</A>
<B> Previous:</B> <A NAME=tex2html1548 HREF="node5.html"> Introduction</A>
<HR> <P>
<H1><A NAME=SECTION00510000000000000000> 1.1. Purpose</A></H1>
<P>
Common Lisp is intended to meet these goals:
<P>
<DL COMPACT><DT><i>Commonality</i>
<DD>
Common Lisp originated in an attempt to focus the
work of several implementation groups, each of which was constructing successor
implementations of MacLisp for different computers. These
implementations had begun to diverge because of the differences in the
implementation environments: microcoded personal computers (Zetalisp,
Spice Lisp), commercial timeshared computers (NIL-the ``New Implementation of
Lisp''), and supercomputers (S-1 Lisp). While the differences among the several
implementation environments of necessity will continue to force
certain incompatibilities among the
implementations, Common Lisp serves as a common dialect to
which each implementation makes any necessary extensions.
<P>
<DT><i>Portability</i>
<DD>
<P>
Common Lisp intentionally excludes features
that cannot be implemented easily on a broad class of machines.
On the one hand, features that are difficult or expensive
to implement on hardware without special microcode are avoided
or provided in a more abstract and efficiently implementable form.
(Examples of this are the invisible forwarding pointers
and locatives of Zetalisp. Some of the problems that they solve
are addressed in different ways in Common Lisp.)
On the other hand, features that are useful only on certain ``ordinary''
or ``commercial'' processors are avoided or made optional. (An example of
this is the type declaration facility, which is useful in some
implementations and completely ignored in others. Type declarations are
completely optional and for correct programs
affect only efficiency, not semantics.)
Common Lisp is designed to make it easy to write programs
that depend as little as possible on machine-specific
characteristics, such as word length, while allowing some variety of
implementation techniques.
<P><DT><i>Consistency</i>
<DD>
Most Lisp implementations are internally inconsistent
in that by default the interpreter and compiler may assign different
semantics to correct programs.
This semantic difference stems primarily from the fact
that the interpreter assumes all variables to be dynamically scoped,
whereas the compiler assumes all variables to be local unless explicitly
directed otherwise. This difference has been the usual practice in Lisp
for the sake of convenience
and efficiency but can lead to very subtle bugs. The definition of
Common Lisp avoids such anomalies by explicitly requiring the interpreter
and compiler to impose identical semantics on correct programs
so far as possible.
<P>
<DT><i>Expressiveness</i>
<DD>
Common Lisp culls what
experience has shown to be the most useful and understandable constructs
from not only MacLisp but also
Interlisp, other Lisp dialects, and other programming languages.
Constructs judged to be awkward or less useful have been
excluded. (An example is the <tt>store</tt> construct of MacLisp.)
<P>
<DT><i>Compatibility</i>
<DD>
Unless there is a good reason to the contrary,
Common Lisp strives to be compatible with Lisp Machine Lisp, MacLisp, and
Interlisp, roughly in that order.
<P>
<DT><i>Efficiency</i>
<DD>
Common Lisp has a number of features designed to
facilitate the production of high-quality compiled code in those
implementations whose developers
care to invest effort in an optimizing compiler.
One implementation of Common Lisp, namely S-1 Lisp, already has a compiler
that produces code for numerical computations that is competitive
in execution speed to that produced by a Fortran compiler [<A HREF="node368.html#S1COMPILER">11</A>].
The S-1 Lisp compiler
extends the work done in MacLisp to produce extremely efficient
numerical code [<A HREF="node368.html#MACLISPBEATSFORTRAN">19</A>].
<P>
<DT><i>Power</i>
<DD>
Common Lisp is a descendant of MacLisp, which has
traditionally placed emphasis on providing system-building tools.
Such tools may in turn be used to build the user-level packages
such as Interlisp provides; these packages are not, however, part
of the Common Lisp core specification. It is expected such packages will
be built on top of the Common Lisp core.
<P>
<DT><i>Stability</i>
<DD>
It is intended that Common Lisp
will change only slowly and with due deliberation. The various dialects
that are supersets of Common Lisp may serve as laboratories within which to
test language extensions, but such extensions will be added to
Common Lisp only after careful examination and experimentation.
<P>
</DL>
<P>
<P>
The goals of Common Lisp are thus very close to those of Standard Lisp
[<A HREF="node368.html#STANDARDLISPREPORT">31</A>] and Portable Standard Lisp [<A HREF="node368.html#PSLMANUAL">51</A>].
Common Lisp differs from Standard Lisp
primarily in incorporating more features, including a
richer and more complicated set of data types and more complex
control structures.
<P>
This book is intended to be a language specification
rather than an implementation specification
(although implementation notes are scattered throughout the text).
It defines a set of
standard language concepts and constructs that may be used
for communication of data structures and algorithms in the Common Lisp
dialect. This set of concepts
and constructs is sometimes referred to as the ``core Common Lisp language''
because it contains conceptually necessary or important features.
It is not necessarily implementationally minimal.
While many features could be defined in terms of others
by writing Lisp code, and indeed may be implemented that way,
it was felt that these features should be conceptually primitive
so that there might be agreement among all users as to their usage.
(For example, bignums and rational numbers could be implemented as
Lisp code given operations on fixnums. However, it is important
to the conceptual integrity of the language that they be regarded
by the user as primitive, and they are useful enough to warrant
a standard definition.)
<P>
For the most part, this book defines a programming language, not a
programming environment. A few interfaces are defined for
invoking such standard programming tools as a compiler, an editor,
a program trace facility, and a debugger, but very little is said
about their nature or operation. It is expected that one or more
extensive programming environments will be built using Common Lisp as a
foundation, and will be documented separately.
<P>
<img align=bottom alt="change_begin" src="gif/change_begin.gif"><br>
There are now many implementations of Common Lisp,
some programmed by research groups in universities
and some by companies that sell them commercially,
and a number of useful
programming environments have indeed grown up around
these implementations.
What is more, all the goals stated above have been achieved,
most notably that of portability. Moving large bodies
of Lisp code from one computer to another is now routine.
<br><img align=bottom alt="change_end" src="gif/change_end.gif">
<BR> <HR><A NAME=tex2html1555 HREF="node7.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html1553 HREF="node5.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html1547 HREF="node5.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html1557 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html1558 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html1556 HREF="node7.html"> Notational Conventions</A>
<B>Up:</B> <A NAME=tex2html1554 HREF="node5.html"> Introduction</A>
<B> Previous:</B> <A NAME=tex2html1548 HREF="node5.html"> Introduction</A>
<HR> <P>
<HR>
<P><ADDRESS>
AI.Repository@cs.cmu.edu
</ADDRESS>
</BODY>