[net.ai] using lisp

leichter (04/22/83)

As far as I've been able to determine, the most important reasons that programs
get written in LISP is:

	1.  The interactive environment.  If LISP was provided ONLY as a
	compiler, a la C or FORTRAN, I seriously doubt there would be much
	interest in it.  The ability to change things on the fly and see the
	results is incredibly powerful.  An interesting sidelight to this is
	the use of pretty-printers.  The LISP language as described in most
	LISP texts does not, as a real matter, exist.  No one reads LISP pro-
	grams as 1-dimensional strings of parentheses and symbols.  Rather,
	LISP is a 2-dimensional language with a 2-dimensional syntax defined
	by its pretty-printers.  Many of the "parenthesis-matching" headaches
	simply do not exist when you have a smart pretty-printer; common con-
	structions appear as particular 2-d structures which are easy to under-
	stand, and misplaced parentheses will tend to distort those structures
	so that they are immediately obvious.

	2.  Simple naming ambiguity.  If you look for commonality across all
	systems that CLAIM to be LISP, about all you will find is the use of
	a fully-parenthesized prefix-Polish syntax and certain common names
	like COND and LAMBDA.  When you consider the huge variation in semantics
	with LISP's having shallow vs. deep binding, dynamic vs. textual scoping
	etc. etc., it becomes meaningless to talk about "the LISP language".
	There are several independent major lines of LISP development - MACLISP,
	INTERLISP, etc. - and moving any non-trivial LISP program across those
	lines can be very difficult.  Even moving WITHIN the lines can be quite
	tough.

	LISP is also very good at producing "embedded languages".  People who
	use these will usually claim to be "using LISP" when most of what they
	are doing has nothing to do with LISP, any more than you are "using
	C" when you use Unix Pascal because the compiler happens to be written
	in C.  (There is a difference, though, in that few of these embedded
	languages are complete enough to stand on their own, so they usually
	provide an "escape" down to the underlying LISP.)

	3.  Inertia.  People in AI were brought up on LISP, know it, and have
	other things in mind than learning a new language.  This ties in with:

	4.  History.  LISP has been used in AI for a long time and there is a
	lot of software already available, just as there is tons of FORTRAN
	software available if you are a numerical analyst.  This ties in with
	point (2) above in an interesting way.  Most recent languages have
	been designed - in a post-PL/I world - on a "keep it as simple as pos-
	sible" philosophy.  The LISP community's philosophy is quite different.
	While PURE LISP is simple, no one uses that.  Instead, they use systems
	built on the "if it's a good idea, throw it in" theory.  LISP is plastic
	enough to allow almost anything to be stuck in if you have a mind to do
	it.  What does "object-oriented programming" have to do with LISP?
	Nothing, if you look at LISP up to a couple of years ago; now, LISP has
	FLAVORS and similar systems.  This habit is one reason that it's just
	about impossible to convince a LISP programmer that language X is
	better than LISP because it has feature Y; if Y is indeed useful, he or
	someone else will soon add Y to LISP (calling the result LISP, of
	course).

	5.  Cognitive dissonance.  While the very basic ideas of LISP are
	simple, real-world LISP's are huge, complex systems.  Becoming an expert
	LISP programmer takes a long time and a lot of effort.  People thus
	want to convince themselves that the effort was worthwhile.  (One sees
	exactly the same phenomenon with assembly-code hackers.)

I think that the single biggest influence, which drives reasons 2,3 and 4 and
thus indirectly 5, is reason 1, interactivity.  Many of the claims that LISP
programmers make - ease of program modification, ability to write large pro-
grams quickly, etc. - are made by APL and SMALLTALK programmers, too, and if
you look behind the words, you find that the big issue is not language as such
but the interactive system.  My own evidence for this:  I have an interactive
version of SNOBOL; the user interface is very similar to APL's.  The difference
between using the interactive system and using straight SNOBOL is incredible.
Many of the advantages claimed for LISP are right there in my system.  (There
are problems, too, but they LISP is not without its problems.)  I've used my
interactive SNOBOL as a vehicle for some of my research, and it's turned out
to be a really pleasant environment - but what's pleasant is the ENVIRONMENT,
not necessarily the language.
							-- Jerry
						decvax!yale-comix!leichter
							leichter@yale