From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Proliferation of Reserved Words Date: Mon, 31 May 2021 22:51:56 +0200 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 31 May 2021 20:51:58 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="74f2840ef2cb8697801c361035142834"; logging-data="13929"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19pgFARvJJhUngJWJYyli7lbl13DGbfqoI=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 Cancel-Lock: sha1:sHsHDPozHwKS2ZRf+1vKqVLVcSA= Content-Language: en-US X-Mozilla-News-Host: snews://news.eternal-september.org:563 Xref: reader02.eternal-september.org comp.lang.ada:62066 List-Id: 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