[comp.lang.misc] Syntactic Issues

icsu8209@attila.cs.montana.edu (Glassy) (06/28/91)

(in response to John Gateley's article...)
>In article <4582@optima.cs.arizona.edu> gudeman@cs.arizona.edu 
>(David Gudeman) writes:
>
>   In article  <GATELEY.91Jun25134644@gefion.rice.edu> John Gateley writes:
>   ]
>   ]I mean that syntax is relatively unimportant.
>
>   How can you say that syntax is unimportant when such a huge percentage
>   of people who try lisp or scheme are turned off by the syntax?  It is
>   certainly important to them.  It is a hindrance to the goal of getting
>   more people to use the language, and it is a distraction for many
>   people trying to use the language.  Just because it isn't a problem
>   for _you_ doesn't mean that it isn't a problem.
>
>Let me try and explain what I mean :^) and at the same time reinforce
>what a couple of later posts have already said. Many people don't like
>Lisp/Scheme true, but to blame it all or even majorly on the syntax is
>unfair. There are many features which require a different mindset:
 ^^^^^^
Unfair, possibly.  Inaccurate?  Hmmm, I think not.  :-)

>recursion instead of loops, first class functions, dynamic typing,
>macros etc. etc. etc. Among all these new features, I think the
i.e., Lisp is 'semantically rich'...see below.

>problem of learning an extremely simple syntax is the smallest of the
>challenge. The syntax is very regular, has very few special
>characters, and can be learned quickly. With a small amount of

maybe -too- regular?

>practice (and EVERY language requires a small amount, or more) the
>programs become understand, and those nasty little parens cease to be
>nasty.
>
   [David Gudeman asserts:  
      ...If you don't think a lot of people are seriously bothered 
      by lisp syntax then you are mistaken.]
>
>I bet that all the people who are bothered by it are much more
>bothered by some of the other features (which are semantic features).
>And, a lot of the problem here is being faced with something "new".

yes, new things terrify many people.

[more stuff on the utility/lack thereof of editors for reading lisp
code deleted]

What say we come up with a (fictional,empirical) function for
"readability" (or "write-only-ness", or whatever title you care to 
give it)...

For a language L, let
   Readability(L) be
      (r,s,rd)
      where
         r is regularity (freedom from exceptions) of L's syntax
         s is the 'semantic richness' of L, ie something corresponding
              to the 'high-level-ness' of L, and 
         rd is the amount of redundancy in L's syntax...

(change composition of this tuple as you see fit...)

(yes, r,s, and rd are not strictly independent!  they're all
inextricably intertwangled, but I think that reflects the nature of the
beast.)

Let's look perhaps at representatives of a few language families:
   Scheme (for the Lisp family of prefix-oriented semi-functional languages)
   Ada (for the Algol family of 'mixfix' ([pre|in|post]fix) imperative
        languages)
   FP (for purely functional languages)

Scheme: r = high, s = high, rd = not much...
Ada: r = livable, s = blecch, rd = lots!
FP:   r = high, s = high, rd = almost none

Comments:

Scheme is a syntactically 'lean' language whose semantics basically
blow most traditional Algol descendants out of the water.  Ada is the
high-water mark of Algol's imperative evolution (least, I hope so!).
FP is a purely functional language whose syntax is stripped to the
point where you can treat it like an algebra (and indeed Backus and
others have).

Other small observations:

-- The students I've met here almost universally dislike LISP.
When I've tried to ferret out why, both "s" (high semantic richness)
and "rd" (very little syntactic redundancy) seem to be major factors.

(Little surprise, this:  the languages taught here are Pascal, C,
MACRO-32 and Fortran.)

-- My own (brief, brutal) exposure to Ada told me there's altogether too
much syntactic dead weight in the language (to my taste), for what you get
semantically. 

-- FP intrigues me.  It's neat when you can do a correctness proof for
a program, in the same language you're programming in.  Attempts to do
this with traditional imperative languages (denotational and axiomatic
semantics) are much more involved.  (I've seen no articles on using
Lisp as an algebra (in the few journals I've read)).

Tentative conclusions:

Raul Rockwell noted that lack of clear docs is a factor in the
"write-only-ness" equation.  I agree.

The "readability" function VARIES alot from person to person.  (no
duh.) Mathematical types (me?) like the sparseness of FP, most of my
compadres here are much closer to the lots-of-redundancy Ada camp, and
the local lispers (there are a few :-) treasure Lisp's semantic
riches...

What I wish for, is that languages with both high "s" and medium-ish
"rd" would replace C and Pascal as teaching languages.  Like Icon,
perhaps.  That way, programmers could be exposed to higher-level
thinking right from the start, and the transition to other ways of
computing ([list|vector|parallel]-processing, functional programming)
would be more straightforward.

Many Schemers say "syntax -is- pretty trivial".  For the non-Scheme
world, I wonder if [and doubt :( ] this is so true.  Redundancy gets in
the way, for some of us; for others, it's what we seem to need and want.

--
Lou Glassy (icsu8209@cs.montana.edu)
disclaimer: I'm a Mk. 1 Mod 0 student, with more opinions than
knowledge, at this point...