Newsgroups: comp.lang.dylan,comp.lang.lisp,comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!newsfeed.rice.edu!bcm.tmc.edu!news.msfc.nasa.gov!newsfeed.internetmci.com!chi-news.cic.net!news.midplains.net!gw2.att.com!nntpa!ssbunews!jwd
From: jwd@ihnns792.ATT.COM (nq8140700-Davison)
Subject: Re: Parenthesized syntax challenge
In-Reply-To: reinder@neuretp.biol.ruu.nl's message of Tue, 17 Oct 1995 10:53:47 +0100
Message-ID: <JWD.95Oct17124606@ihnns792.ATT.COM>
Sender: news@ssbunews.ih.att.com (Netnews Administration)
Nntp-Posting-Host: ihnns792.ih.att.com
Reply-To: Joseph_W_Davison@.ATT.COM
Organization: AT&T Bell Laboratories
References: <44aa9a$j5h@miso.cs.uq.edu.au> <ppotts-2809951909280001@198.11.57.140>
	<OZ.95Oct10235418@nexus.yorku.ca> <45m10h$dl0@louie.disney.com>
	<DGJx4L.Fsr@cogsci.ed.ac.uk>
	<reinder-1710951053470001@neuretc.biol.ruu.nl>
Date: Tue, 17 Oct 1995 17:46:06 GMT
Lines: 85
Xref: glinda.oz.cs.cmu.edu comp.lang.dylan:5441 comp.lang.lisp:19556 comp.lang.scheme:14030

Reinder Verlinde writes:
 Jeff Dalton wrote:

 > ) I think people sometimes make a too-simple claim that looks sort of
 > ) like this:
 > ) 
 > )   Lisp syntax gives you program-as-data, and that gives you
 > )   Lisp-style macros (which are far superior to substitution
 > )   macros and the like).
 > ) 
 > ) Perhaps someone else can come up with a better version of this
 > ) argument, because when I do it I get something that's rather
 > ) unconvincing.  I've tried several variations, and they're all

 > To prevent this thread from extinction ;-) a quick counterargument:
 > (disclaimer: I have never played with a quality LISP system, and never
 >  really _used_ a LISP system at all; $0.02 may be a high value for this
 >  argument)

 >  - assembler gives you the power to do everything you want

 > Q: Why then is everybody using higher-level languages?

 > A: Because they allow you to use code others wrote

 > Isn't bare LISP something like this? Even the LISP afficionadas
 > I encounter in this group admit that LISP without macros is
 > something different from "real LISP". 'They' even admit that
 > macros can be used to design new languages, which sometimes are
 > only understood by the programmer him/erself.

Actually, I find strong resemblences, for this argument, between Assembler
syntax and Lisp syntax.  "Both" "languages" have particularly simple syntaxes
which makes the creation of very powerful macro processors simple enough
that it has actually been done.  The result is that they are among the few
extensible languages that seem to be in actual use.

Unfortunately, most assembly languages I've seen really don't have macro
languages as powerful as Lisp, certainly not on today's machines.  On the
other hand, I'm an "old" electronic switching system developer for AT&T,
and the macro language used in the SWAP (SWitching Assembler Program, I
think) language used on the early ESS systems basically included SNOBOL as
a subset.  One particularly powerful feature, UNIOP, basically allowed
replacing the parser.  For instance "   UNIOP TABLE" meant, from now on,
treat every line as if it had "TABLE" as the opcode.  If one had defined
TABLE as a macro, the TABLE macro would be called with the actual line as
input.  This capability was used to create application oriented languages
(AOL) that greatly simplified writing switching features, because they
encapsulated specialized knowledge in a much simpler interface.  A typical
feature developer wrote in a mixture of "pure" assembler and these AOLs.
These AOLs tended to be declarative; the user took some high level aspect
of the problem to be solved, (for instance, the number of lines and trunks
involved in a path hunt), looked it up in "the manual", to find relevent
terms, and then provide other information needed to allow the macro to
generate the appropriate code.  The macros were owned and cared for by a
couple of gurus who were the only ones who really understood path hunts,
(or whatever), but it certainly made life simpler for the rest of us.

Later, we replaced SWAP with C, and every programmer got to know all the
details themselves -- a Great Leap Forward, as you can guess.

I think this ability to embed AOLs within a larger language is a key
capability of extensible languages.  The simple syntax of Lisp and
assembler made it easier to write macro processors that could do the job.
I'm sure other ways are possible and I'm looking at Cardelli's papers with
interest.

However, it's not just this AOL capability that results from the simple
syntax.  Many other tools for manipulating the language are simpler to
write as a result of the simple syntax.  Writing awk scripts to extract
information from Lisp programs is easier than writing awk scripts to
extract information from C.  Yuk! you say...  Well, you don't have to use
such simple tools.  The point is the simple syntax makes it possible for
many more people to write useful tools to manipulate lisp programs than can
write useful tools to manipulate C++ programs.  It makes it easier to imagine
how a tool might work, so the tool has a chance to become a reality.  

I agree, the argument for Lisp-like syntax isn't made by these remarks, but
I think this idea is a key part of it.  It isn't just the simple syntax,
it's also the simple mapping between a simple syntax and a clearly defined
semantics. Writing a grammar for C++ isn't the hard part of developing a
tool to digest C++ programs...

--
Joe Davison 	joseph_w_davison@att.com
