Xref: utzoo comp.lang.lisp:3593 comp.lang.scheme:1632 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!samsung!uunet!mcsun!ukc!edcastle!aiai!jeff From: jeff@aiai.ed.ac.uk (Jeff Dalton) Newsgroups: comp.lang.lisp,comp.lang.scheme Subject: Virtues of Lisp syntax Message-ID: <3368@skye.ed.ac.uk> Date: 5 Sep 90 18:07:59 GMT References: <1990Aug26.205018.18067@cbnewsc.att.com> <1350028@otter.hpl.hp.com> Reply-To: jeff@aiai.UUCP (Jeff Dalton) Organization: AIAI, University of Edinburgh, Scotland Lines: 125 In article <1350028@otter.hpl.hp.com> sfk@otter.hpl.hp.com (Steve Knight) writes: >With trepidation, I'd like to try to make a couple of points about Lisp >syntax. The important thing to understand about (many, perhaps most, of) the people who like Lisp is that they like the syntax and indeed prefer it to the more Algol-like alternatives. They are not, in their view, sacrificing something in order to get extensibility (or whatever). And if they wanted a different syntax, they would build it on top of Lisp. So I think it's important to get the issues right. What it comes down to, in my opinion, is that some people don't like Lisp syntax and are consequently willing to use more complicated mechanisms for getting some of the same benefits. There isn't much that can be done about this except, when necessary, pointing out some better ways of using and understanding Lisp. No one has to like Lisp in the end, but at least then they'll have given it a fair shot. >The basic point is that the virtues claimed for Lisp syntax >are not exclusive to Lisp. Actually, the full set of virtues is exclusive to Lisp in the sense that no other language offers the same set. (I am of course counting Scheme as a kind of Lisp here.) >Lawrence writes: >> Simplicity is nice, but extensibility is the much more important >> virtue of Lisp syntax. I think it's misleading to consider such things in isolation. >It is quite easy to imagine a programming language with (say) an Algol-like >syntax in which the parse tree is available as a standard data-structure. And many such languages have been built on top of Lisp. >Speaking personally, I am no fan of the Lisp or Prolog style of syntax. >It seems to me to be an unfortunate conflation of issues -- external >syntax is there to make programs readable etc -- internal structure is >there to make manipulation of programs convenient. My view is just the opposite. It's fortunate that a readable external syntax can correspond so closely to a flexible, easily manipulated data structure. > I think that Prolog >makes the better job of it, having the advantage of being relational so >that quoting rules aren't required, and providing a good infix/prefix/ >postfix operator system. It's not because Prolog is relational that quoting rules aren't required. And instead of quoting, Prolog has case conventions. Variables begin in upper case, symbolic constants ("atoms") don't. And to have something that begins in upper case treated as an atom you have to ... wait for it ... put (single) quotes around it. (Yes, I know we can argue about whether these quotes are like the Lisp quote or like the |...| syntax.) BTW, the Lisp quoting rules needn't be any more confusing than the quoting rules of, say, Basic. >I agree with Lawrence in >thinking that many folks pre-judge on the basis of ignorance, it would be >odd if it wasn't true! However, the issue of Lisp's syntax is largely >independent of programming environment -- you don't need Lisp's syntax >to do sensible things with programs. The syntax issue is not independent of programming environment. But this is not a claim that you need Lisp in order to do "sensible things" -- it's possible to do sensible things with a variety of languages -- but rather the observation that Lisp *requires* a certain kind of programming environment if it's to be used effectively. (In particular, indentation is the key to making Lisp readable, and an editor that does much of it for you is a big help.) When students, for example, try to write Lisp programs without an editor with a good Lisp mode, it's not surprising that they find it difficult. And since they don't know what it would be like to use a better editor, it's not surprising that they think Lisp is to blame. On the other hand, Lisp *does* make it easier than other languages to do certain sensible things. >I am inclined to think that the best interpretation of Lawrence's >observation is that expensive Lisp equipment is of much more interest to >folks who are prepared to tolerate the problems with Lisp. That's true, of course, if you think of Lisp programmers as tolerating problems. >And I would count the syntax as, overall, a problem because the >benefits could be achieved without the cost. Let me try to be clear at the risk of repetition. Many Lisp programmers do not regard it as a cost; they regard the syntax as a benefit. Many, and not just because they're "used to" Lisp, find Lisp *easier* to read than other languages that have a more complicated syntax. Moreover, the combination of benefits available in Lisp cannot be achieved (without giving up something) in other languages. >> Indeed, the "haters" usually >> have never used any Lisp system beyond the 1962-vintage Lisp 1.5 that >> most of us oldsters were introduced to in undergraduate school. > >That doesn't ring a bell with me. My (UK based) experience is that people's >exposure is to Lisp's such as Lucid. This doesn't really sweeten >the experience, to be fair, since so many commercial lisp systems have >intense memory requirements -- which ends up spoiling the experience. This has been my experience as well. Scheme is much better, I think, at creating a good initial impression. >Another factor in the development of attitudes hostile to Lisp, in my view, >is the bias of university teaching. (I'm only talking about the UK here.) I agree, and it can be true in the US as well. Jeff Dalton, JANET: J.Dalton@uk.ac.ed AI Applications Institute, ARPA: J.Dalton%uk.ac.ed@nsfnet-relay.ac.uk Edinburgh University. UUCP: ...!ukc!ed.ac.uk!J.Dalton