| Related articles |
|---|
| From: | Thomas Koenig <tkoenig@netcologne.de> |
| Newsgroups: | comp.compilers |
| Date: | Tue, 4 Jan 2022 19:23:04 -0000 (UTC) |
| Organization: | news.netcologne.de |
| References: | 21-12-003 21-12-017 21-12-022 21-12-026 21-12-033 22-01-007 22-01-010 |
| Injection-Info: | gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="83086"; mail-complaints-to="abuse@iecc.com" |
| Keywords: | parse, history |
| Posted-Date: | 04 Jan 2022 14:46:22 EST |
> [In original Dartmouth BASIC the LET was mandatory, but it was a considerably
> smaller and fully compiled language than the later dialects. On the other
> hand, PL/I made a fetish of nothing being a reserved word, e.g.
>
> IF IF = THEN THEN ELSE = BEGIN; ELSE END = IF;
Fortran shares this property.
This may sound slightly odd to people brought up on languages with
reserved keywords, but it has a big advantage: You can extend the
language with new keywords without making existing programs invalid.
There is a cost to this, in several aspects:
- More CPU time needed for parsing (important earlier, now it
can generally be neglected).
- More complexity in the parser. This cost is paid once, and
by the compiler developers, not the users.
- Similarity to FORTRAN may induce fear and loathing in computer
scientists (the last remark is not to be taken too seriously :-)
[Fortran barely had tokens since it ignored spaces outside of Hollerith
strings. Having written a few F77 parsers, I can say it was possible
to tokenize using hints from the parser about what lexical kludge to
apply, but it wasn't pleasant. The yacc parser was straightforward
other than figuring out when to send which kludge ID to the lexer.
It also meant that one character typos could cause large semantic
changes, notably DO 5 I = 1,10 is a loop while DO 5 I = 1.10
is an assignment. Legend says we lost a satellite to that one.
-John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.