Programming language syntax design (was Re: ... typedef problem)

landauer@morocco.Eng.Sun.COM (-8 Doug Landauer 8-)
14 Jan 1992 23:58:05 GMT

          From comp.compilers

Related articles
Handling the typedef problem with a modifiable grammar bburshte@pyrps5.eng.pyramid.com (1992-01-09)
Handling the typedef problem with a modifiable grammar bevan@computer-science.manchester.ac.uk (Stephen J Bevan) (1992-01-13)
Programming language syntax design (was Re: ... typedef problem) landauer@morocco.Eng.Sun.COM (1992-01-14)
Programming language syntax design (was Re: ... typedef problem) bevan@computer-science.manchester.ac.uk (Stephen J Bevan) (1992-01-15)
Re: Programming language syntax design (was Re: ... typedef problem) anw@maths.nott.ac.uk (1992-01-17)
Re: Programming language syntax design (was Re: ... typedef problem) bliss@sp64.csrd.uiuc.edu (1992-01-20)
| List of all articles for this month |

Newsgroups: comp.compilers
From: landauer@morocco.Eng.Sun.COM (-8 Doug Landauer 8-)
Keywords: parse, design
Organization: Sun Microsystems, Mt. View, Ca.
References: 92-01-043 92-01-049
Date: 14 Jan 1992 23:58:05 GMT

> So please, any budding language designers/extenders out there, think long
> and hard about about the syntax of the language and its impact on checking
> context conditions (or static semantics if you prefer)
>
> [On the other hand, some of us would put "easy to parse using yacc" fairly
> low on our list of criteria for good language design. -John]


On the other other hand, I would expect "easy for humans to parse quickly"
should be very high on everyone's list. The worst problem with these
kinds of syntax design mistakes is not so much the inconvenience that it
causes compiler implementors; rather, it is the fact that if the lexer
and/or parser have to jump through hoops to classify a construct, then so
does the *person* trying to read this code. The existence of these kinds
of not-quite-ambiguities make the language itself (i.e., *any* program
written in that language) inherently less readable. This is bad but sorta
manageable in C; it's just scary in C++.


> Q: which language has the best syntax?
> A: Lisp/Scheme, as there isn't any concrete syntax.
> You program directly in the abstract syntax.


I'm not quite sure what you mean here; I do believe that it is the
difficulty that most humans have parsing LISP that is one of the major
factors that has prevented that language from becoming as popular as its
proponents might like for it to be.


(Is this thread more suitable for comp.lang.misc now?)
--
Doug Landauer -- landauer@eng.sun.com _
Sun Microsystems, Inc. -- STE, SunPro, Languages
--


Post a followup to this message

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