Re: language design implications for variant records in a pascal-like language

glen herrmannsfeldt <gah@ugcs.caltech.edu>
Mon, 10 Jan 2011 08:37:40 +0000 (UTC)

          From comp.compilers

Related articles
[27 earlier articles]
Re: language design implications for variant records in a pascal-like gneuner2@comcast.net (George Neuner) (2011-01-06)
Re: language design implications for variant records in a pascal-like gneuner2@comcast.net (George Neuner) (2011-01-06)
Re: language design implications for variant records in a pascal-like gneuner2@comcast.net (George Neuner) (2011-01-06)
Re: language design implications for variant records in a pascal-like bobduff@shell01.TheWorld.com (Robert A Duff) (2011-01-06)
Re: language design implications for variant records in a pascal-like DrDiettrich1@aol.com (Hans-Peter Diettrich) (2011-01-08)
Re: language design implications for variant records in a pascal-like robin51@dodo.com.au (robin) (2011-01-10)
Re: language design implications for variant records in a pascal-like gah@ugcs.caltech.edu (glen herrmannsfeldt) (2011-01-10)
Re: language design implications for variant records in a pascal-like haberg-news@telia.com (Hans Aberg) (2011-01-10)
Re: language design implications for variant records in a pascal-like compilers@is-not-my.name (2011-01-10)
Re: language design implications for variant records in a pascal-like martin@gkc.org.uk (Martin Ward) (2011-01-12)
Re: language design implications for variant records in a pascal-like martin@gkc.org.uk (Martin Ward) (2011-01-12)
Re: language design implications for variant records in a pascal-like DrDiettrich1@aol.com (Hans-Peter Diettrich) (2011-01-12)
Re: language design implications for variant records in a pascal-like mcr@wildcard.demon.co.uk (Martin Rodgers) (2011-01-12)
[22 later articles]
| List of all articles for this month |
From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: Mon, 10 Jan 2011 08:37:40 +0000 (UTC)
Organization: A noiseless patient Spider
References: 10-12-040 10-12-043 11-01-005 11-01-009 11-01-027
Keywords: design, syntax
Posted-Date: 12 Jan 2011 00:15:20 EST

Robert A Duff <bobduff@shell01.theworld.com> wrote:
(previously I wrote)


>> Part of the design of PL/I was that you wouldn't have to learn all of
>> it to use it.


> A worthy goal.


>>...That was used as the reason for not having reserved
>> words. (You have to at least know the word to know not to use it.)


> I don't see that. I mean, you don't actually have to memorize the
> list of reserved words. You get an error message, saying you used a
> reserved word as an identifier, so you fix it and recompile.


I usually try to fix more than one between compiles, but sometimes.


But when computer time was $100/CPU hour, and the time between job
submission and when you saw the results was hours or days, then it
mattered more.


> After a while, you've memorized all the reserved words you're likely
> to use incorrectly. Failure to know some obscure reserved word
> won't cause a (run-time) bug.


You hope that all misused reserved words cause a fatal compilation
error, but I am not sure that is always true.


> At least, that's true if the compiler gives good error messages
> about obscure reserved words. "Reserved word 'until' used as an
> identifier.", as opposed to "Compiler saw 'until', and is now


I believe disallowing implicit declaration is pretty important to be
sure that misused reserved words are detected, but then that is usual
in newer languages.


But also reserved words complicates adding new features, along with
new reserved words, to an existing language. Well, if someone plans
ahead and reserves some words for future use, such as Java reserving
goto just in case they some year decide to add it.


>> Also, the huge list of reserved words for COBOL may have been on the
>> mind of PL/I designers.


> Sounds likely. In other words, "COBOL has too many reserved words,
> therefore reserved words are evil, therefore let's eliminate reserved
> words." Overreaction?


Counting only English words, C has a fairly small number of reserved
words. (I don't usually use strlen in conversation, but I might use
length.) Even so, once in a while I will find one that I otherwise
would have used.


I do remember in some Fortran programs years ago using FORMAT as the
name of an array for storing a run-time format into. Also, one might
want if as the variable between ie and ig.


> [Back when PL/I was designed, "recompile" meant resubmitting a deck
> of cards and potentially waiting several hours. To avoid that
> problem, COBOL programmers did wacky things like starting all
> variable names with a digit, just to avoid the reserved words. These
> days I agree, reserved words are less of a big deal, but modern
> languages don't have 400 reserved works like COBOL does. -John]


I have still not written any COBOL, though some day maybe just to
say that I did. I do remember the stories, though, of having to
keep the list nearby to avoid using any of the words.


I didn't know you could start with a digit. Verilog also allows
for that, and I did have to do it once.


-- glen


Post a followup to this message

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