Re: problems with identifiers and keywords...

vbdis@aol.com (VBDis)
7 Nov 2004 12:09:09 -0500

          From comp.compilers

Related articles
[2 earlier articles]
Re: problems with identifiers and keywords... gah@ugcs.caltech.edu (glen herrmannsfeldt) (2004-10-24)
Re: problems with identifiers and keywords... clint@0lsen.net (Clint Olsen) (2004-10-25)
Re: problems with identifiers and keywords... cfc@shell01.TheWorld.com (Chris F Clark) (2004-11-02)
Re: problems with identifiers and keywords... gah@ugcs.caltech.edu (glen herrmannsfeldt) (2004-11-06)
Re: problems with identifiers and keywords... wclodius@lanl.gov (2004-11-06)
Re: problems with identifiers and keywords... wyrmwif@tsoft.org (SM Ryan) (2004-11-07)
Re: problems with identifiers and keywords... vbdis@aol.com (2004-11-07)
Re: problems with identifiers and keywords... cfc@shell01.TheWorld.com (Chris F Clark) (2004-11-14)
Re: problems with identifiers and keywords... genew@mail.ocis.net (Gene Wirchenko) (2004-11-14)
Re: problems with identifiers and keywords... gah@ugcs.caltech.edu (glen herrmannsfeldt) (2004-11-17)
Re: problems with identifiers and keywords... gah@ugcs.caltech.edu (glen herrmannsfeldt) (2004-11-17)
Re: problems with identifiers and keywords... lkrupp@pssw.NOSPAM.com.INVALID (Louis Krupp) (2004-11-17)
Re: problems with identifiers and keywords... cfc@shell01.TheWorld.com (Chris F Clark) (2004-11-17)
[12 later articles]
| List of all articles for this month |
From: vbdis@aol.com (VBDis)
Newsgroups: comp.compilers
Date: 7 Nov 2004 12:09:09 -0500
Organization: AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com
References: 04-11-011
Keywords: parse, syntax
Posted-Date: 07 Nov 2004 12:09:08 EST

  glen herrmannsfeldt <gah@ugcs.caltech.edu> schreibt:


>A question one could ask is: should a language be designed to be easy
>for compilers or easy for people. Unless I am writing the compiler,
>I would say it should be easy for people.


I think that languages should be "easy" anyhow. Complicated syntax and
exceptions are appreciated neither by the user nor by the compiler
writer. Have a look at C declarations, these can become very
unreadable to the human, and the compiler has to guess and look ahead
a lot. The Pascal declaration syntax in contrast is straight forward,
easy to read an understand by both humans and parsers. And compare the
amount of annotations, which are required to describe where the syntax
differs from the semantics.


I only know of one topic where the "ease" really is different. This is
when "easy for people" means "minimal keystrokes", for people that are
not skilled typewriters. When we look at older Basics, then the editor
could extend shortcuts into the appropriate long form. Just in this
case the editor should know immediately what the user has in mind, so
that every shortcut can be expanded without waiting for more following
text. Another form of "easy to enter" are short keywords, like the
many non-alphanumeric keys in C. It's questionable whether such code
is "easy to read" afterwards, and with the assumption that text is
more often read than written, I prefer easily readable (verbose)
source code. Humans are used to read text, and have optimized their
parser to jump from one keyword to the next one, skipping "syntactic
sugar" in between. In so far readable keywords in programming
languages make source code comprehensible like text, in contrast to
abbreviated text (or non-alphabetic keywords) where the human "parser"
has to guess or to inspect the context in order to figure out the
meaning of the abbreviated text as a whole.


2b|~2b?


I bet it takes much more time to figure out the meaning of this
"text", as opposed to the verbose Shakespeare text ;-)


Of course (some) humans also are used to read formulas quickly, but
program code consists of many other constructs than just expressions.


DoDi


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.