From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Proliferation of Reserved Words
Date: Mon, 31 May 2021 22:51:56 +0200 [thread overview]
Message-ID: <s93i9e$dj9$1@dont-email.me> (raw)
Ada 83 (in)famously had 63 reserved words, which was considered a lot at the
time (languages like C and Pascal had about half that). Considering only those
related to tasking, there were 7:
abort accept do entry select task terminate
Yet many of these have similar/related meanings, and perhaps some overloading
would have been a good idea.
entry and accept ... do go hand in hand. One could replace accept with something
like an entry body, eliminating 2 reserved words.
An entry is very like a procedure, so one could use procedure instead. It might
be necessary to distinguish between a "task procedure" (declared in a task spec)
and a "normal procedure" (declared anywhere else). Another reserved word eliminated.
abort/terminate are pretty much the same thing. We could eliminate abort and
just use terminate. (One could argue for using end, but given how often "end
Name;" appears when not terminating a task, that would be confusing.)
So we're left with select, task, and terminate, less than half as many. I
haven't looked in detail at the others, but presumably some reduction is
possible there.
Ada 95 added protected and requeue. Some Ada-83 compilers implemented "passive
tasks" that were similar to protected objects; formalizing that would have
required defining pragma Passive, leaving no need for protected.
There may be a need for requeue, but I've only used it to work around the
limitations on what a protected action may do, so I'm skeptical.
ISO/IEC 8652:2007 added synchronized. I think that could have simply reused task.
Ada 12 didn't expand this set of reserved words.
Ada 2X proposes adding parallel. Again, I think reusing task ("task begin" and
"task loop") would be fine.
So we will have 11 tasking-related reserved words (unless I've missed some), but
we only need select, task, and terminate (and maybe requeue), nearly a factor of
4 difference.
Maybe Ada 3X will add concurrent, and then there won't be any tasking terms that
aren't reserved words.
What do others think? Should Ada have made a greater effort at overloading
reserved words from the beginning? Should we belatedly object to adding parallel
when we have so many choices already? Or is having a large set of reserved
words, many of them with similar meanings, a good thing?
--
Jeff Carter
"Spam! Spam! Spam! Spam! Spam! Spam! Spam! Spam!"
Monty Python's Flying Circus
53
next reply other threads:[~2021-05-31 20:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-31 20:51 Jeffrey R. Carter [this message]
2021-05-31 21:27 ` Proliferation of Reserved Words Dmitry A. Kazakov
2021-06-01 5:54 ` Randy Brukardt
2021-06-01 7:40 ` Paul Rubin
2021-06-03 8:48 ` Robin Vowels
2021-06-01 9:51 ` Jeffrey R. Carter
2021-06-01 16:06 ` Simon Wright
2021-06-01 11:48 ` Luke A. Guest
2021-06-02 18:13 ` AdaMagica
2021-06-02 19:21 ` Dmitry A. Kazakov
2021-06-02 20:13 ` Chris Townley
2021-06-02 20:18 ` Jeffrey R. Carter
2021-06-02 23:23 ` Bill Findlay
2021-06-03 23:58 ` Keith Thompson
2021-06-04 6:58 ` Dmitry A. Kazakov
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox