[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
several questions, some trivial
- To: fateman%ucbdali@Berkeley (Richard Fateman)
- Subject: several questions, some trivial
- From: "Scott E. Fahlman" <Fahlman@CMU-CS-C.ARPA>
- Date: Sat, 15 Sep 1984 23:30:00 -0000
- Cc: common-lisp@SU-AI.ARPA
- In-reply-to: Msg of 14 Sep 1984 12:40-EDT from fateman%ucbdali at Berkeley (Richard Fateman)
- Sender: FAHLMAN@CMU-CS-C.ARPA
If we look at Maclisp with (declare (special t)), is it not the
case that (nearly) identical semantics are used for the interpreter
and compiler, given CORRECT programs?
Sure, there are lots of special cases in which Maclisp's interpreted
behavior matches its compiled behavior. The point is that few users
want all of their variables to be special and that a LOT of Maclisp
programs break when you compile them because of the different treatment
of special and local variables. In Common Lisp, this big difference
between compiled and interpreted code goes away, along with some lesser
problems. That's what's being touted. I don't think this clean-up is
of revolutionary importance, but it certainly eliminates a long-standing
embarassment and a source of considerable confusion for new users. If
people are touting this as a great advance in the theory and practice of
programming, then they're guilty of exaggeration, but it is one small
thing that Common Lisp does better than most earlier Lisps.
Since most programs are, for most of their lives, "incorrect", aren't we
open to the accusation of missing the main point here?
I disagree with your premise. Most of my programs, for most of their
lives, are correct, at least if by program you mean "Lisp function".
Obviously, any sufficiently large system will have a couple of bugs in
it somewhere, even after it is tested and released, but the point is
that compilation does not normally change the program's behavior except
at these few points, and probably only at a small minority of those.
The new thing is that we have made it an explicit goal of the language
design (though not the only goal) that compilation should not change
behavior, and we have made a serious attempt to fulfill this goal. In
particular, we eliminated the single largest violation of this principle
that is present in most earlier Lisps. As you say, a user can still
screw himself by doing really perverse things like redefining CAR at
runtime, but I don't think I've ever seen a user screw himself by
accident when he compiled a Common Lisp program, and this used to happen
all the time in Maclisp and Franzlisp.