Newsgroups: comp.lang.lisp,comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!rochester!hood.cc.rochester.edu!news.acsu.buffalo.edu!newsstand.cit.cornell.edu!portc01.blue.aol.com!chi-news.cic.net!arclight.uoregon.edu!su-news-hub1.bbnplanet.com!news.bbnplanet.com!newsxfer3.itd.umich.edu!newsxfer.itd.umich.edu!uunet!in3.uu.net!192.35.48.11!hearst.acc.Virginia.EDU!murdoch!bootp-17-17.bootp.virginia.edu!user
From: "" <sdm7g@Virginia.EDU>
Subject: Thin syntax, not parenthesis or prefix [was: Why lisp failed in the marketplace]
X-Nntp-Posting-Host: bootp-17-17.bootp.virginia.edu
Message-ID: <sdm7g-0303971532410001@bootp-17-17.bootp.virginia.edu>
Sender: usenet@murdoch.acc.Virginia.EDU
Organization: University of Virginia
X-Newsreader: Microsoft Internet Mail and News for Macintosh - 1.0 (22)
References: <5edfn1$83b@Masala.CC.UH.EDU> <m3pvxxylnf.fsf@laphroig.mch.sni.de> <330B3744.10E3@acm.org> <5f0gn3$hd$1@goanna.cs.rmit.edu.au>
Date: Mon, 3 Mar 1997 15:32:41 GMT
Lines: 75
Xref: glinda.oz.cs.cmu.edu comp.lang.lisp:25827 comp.lang.scheme:19014


The "problem" with Lisp syntax isn't the prefix notation or the parenthesis,

it's the fact that the syntax is so thin. Lisp has the same problem that
Forth
displays to an even larger degree -- Forth has essentially NO syntax. It has

lexing into space separated tokens. Each work or token has it's own
semantics. 
You can't read and understand Forth code unless you understand esentially 
every word.  The solution to this in forth is to heavily comment the source 
code with notes about how each word changes the state of the virtual
machine. 
It's all semantics, and any token can temporarily change the few global
syntax
rules. 

Lisp at least has parenthesis and some grammar, but there is very little
global
syntax that can't be suspended by a macro or reader-macro. There is nothing
in the syntax to indicate which words are control-structures or macros and
which are functions. Position does help differentiate between
functions/macros
and data/parameters, but as with Forth, you can write powerful reader macros
that essentially suspend all of the normal rules. 

In practice, programmers rarely use all of these features to write the most
obfuscated
code possible. But, as in Forth, you are still dependent on the discipline
of the (other)
programmer, who has to choose names wisely to produce readable code. 


Compared to this, code formatting, parenthesis, pretty-printing, etc. is all
a trivial problem. 


However, I use the word "problem" above in quotes. 
This feature is a disadvantage for producing readable and reusable code, but
it is 
an advantage in other contexts. It's the source of much of the flexibility
of Lisp - 
the ability to easily produce a sub-language very close to the problem
domain. 
Also, the syntax is so simple, there is not much room for wrong choices --
languages
with a more complex syntax often have problems with interaction of language
syntax
features. Firmer global syntax rules help readability, but reduce
flexibility. Lisp and
Forth are both great languages to WRITE code in, but difficult to read in
the large.


Lisp / Forth / Natural Language all get power from:
	[1] relatively small syntax/grammar.
 [2] relatively large vocabulary. 
 [3] combinatory rules to 
	     [1] define new vocabulary.
      [2] suspend or change the grammar within a defined context. 


P.S. I like and use Lisp. It's not perfect. But if we're going to have a
critique, lets  
not waste time on false issues like whether parenthesis or prefix notation
is "natural". 


-- Steve Majewski <sdm7g@Virginia.EDU> 

programming language critiques page is at
http://galen.med.virginia.edu/~sdm7g/LangCrit/
but it hasn't been updated for some time. There are loads of new Java
critiques that I
ought to get posted there. I'm too busy Lisp programming right now! 
