Related articles |
---|
What attributes of a programming language simplify its use? gah4@u.washington.edu (gah4) (2022-12-01) |
Re: What attributes of a programming language simplify its use? gah4@u.washington.edu (gah4) (2022-12-02) |
Re: What attributes of a programming language simplify its use? tkoenig@netcologne.de (Thomas Koenig) (2022-12-03) |
Re: What attributes of a programming language simplify its use? DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2022-12-03) |
Re: What attributes of a programming language simplify its use? christopher.f.clark@compiler-resources.com (Christopher F Clark) (2022-12-03) |
Re: What attributes of a programming language simplify its use? gah4@u.washington.edu (gah4) (2022-12-03) |
Re: What attributes of a programming language simplify its use? Keith.S.Thompson+u@gmail.com (Keith Thompson) (2022-12-06) |
Re: What attributes of a programming language simplify its use? gah4@u.washington.edu (gah4) (2022-12-06) |
[6 later articles] |
From: | gah4 <gah4@u.washington.edu> |
Newsgroups: | comp.compilers |
Date: | Fri, 2 Dec 2022 02:09:52 -0800 (PST) |
Organization: | Compilers Central |
References: | 22-12-001 |
Injection-Info: | gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="4781"; mail-complaints-to="abuse@iecc.com" |
Keywords: | design, history |
Posted-Date: | 02 Dec 2022 11:50:25 EST |
In-Reply-To: | 22-12-001 |
On Thursday, December 1, 2022 at 4:18:24 PM UTC-8, gah4 wrote:
(snip)
> One feature that I find makes them easier to use, and harder to implement, is no reserved words.
(snip)
> [I take your point, but in PL/I you can say:
>
> IF THEN = ELSE THEN BEGIN = IF; ELSE END = IF;
>
> COBOL famously has too many reserved words but PL/I overreacted. -John]
COBOL had many useful English words used.
As well as I know it, the idea for PL/I was that you shouldn't need to know
about the parts of the language that you weren't using, even know the words.
But also, PL/I more than other languages has simple rules, instead
of arbitrary restrictions. You can use any expression in any place where
an expression is allowed.
Fortran has always, and still does, have unobvious restrictions on how
expressions can be used. Some it seems intentionally to make it harder
for the programmer. That is, to discourage practices that some don't like.
My favorite complaint is about using REAL variables in DO loops.
Yes there are good reasons not to do it, but it isn't up to the language
to decide that.
The actual reason I follow this one, is that many (many!) years ago
I would sometimes translate BASIC programs to Fortran, where all
variables are Fortran REAL.
PL/I allowed array expressions from the beginning, Fortran added
them much later. PL/I has a simple rule. The subscripts have the
same value for all arrays in the expression.
Fortran has complicated rules, where some arrays index from one,
even if they are declared with different lower bound. You have to
be extremely careful, which one it is using. And it gets even worse
when you pass arrays to subroutines.
But back to the reserved words. Just because it allows them,
doesn't mean that you should use them. In all cases, the person
writing the program should consider readability. And using IF
related words in an IF statement is bound to be confusing.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.