From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,28b389d4503cb555 X-Google-Attributes: gid103376,public From: "Robert I. Eachus" Subject: Re: generic package dilemma Date: 1999/12/01 Message-ID: <38459568.8DAF60@mitre.org>#1/1 X-Deja-AN: 555489223 Content-Transfer-Encoding: 7bit References: <80u48b$ghr$1@bunyip.cc.uq.edu.au> <3832e27f_1@news1.prserv.net> <3832E75D.5B1BA719@mail.com> <383319e8_4@news1.prserv.net> <3833F615.5AD7166C@mail.com> <383442e1_1@news1.prserv.net> <383510EA.9DFEE8B6@mail.com> <383569db_2@news1.prserv.net> <3835CF7A.5604C6A3@mail.com> <81bt4v$7cr$1@nnrp1.deja.com> <383982E4.110F0F2D@mail.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.mitre.org X-Trace: top.mitre.org 944083942 8242 129.83.41.77 (1 Dec 1999 21:32:22 GMT) Organization: The MITRE Corporation Mime-Version: 1.0 NNTP-Posting-Date: 1 Dec 1999 21:32:22 GMT Newsgroups: comp.lang.ada Date: 1999-12-01T21:32:22+00:00 List-Id: Robert A Duff wrote: > I certainly don't believe the designers of Ada 83 (in 1980) thought it's > possible for compiler to solve the halting problem. I think they just > wrote the rule in a slightly sloppy way. They could have rewritten it > to say what they always meant, but instead they chose to go with > run-time checking -- I presume because that makes things simpler by > avoiding a link-time analysis of the entire program's call graph. I don't think so. We started building SLANG as a subset of Ada 80. It later grew to be a pretty large subset of Ada 83 (and changed it's name to Ada/SIL). This compiler had a rather agressive optimizer that created and heavily used the call graph. For example it would combine the stack frames for non-recursive subprograms with the parent, which required some pretty sophisticated static analysis. After Ada82 was published, it would also eliminate the "elaborated" bit, and any checks for it in any unit that could be statically shown not to be called before elaboration. I argued fairly strongly for making elaboration checks dynamic based on what we found when trying to implement the Ada 80 rules. Most small programs were easy to find an elaboration order for and (later) eliminate all elaboration checks. But larger programs would hit a complexity barrier where finding a static elaboration order--if one existed--took longer than compiling all of the compilation units. Putting elaboration bits in just a few packages dramatically decreased link times. There were three packages that got hit all the time, but I'll give one example: Good belt and suspenders programming practice is to include in exception handling code a quick message to tell what went wrong. Some of these stay in the delivered version, some are inserted during debugging and taken out during integration along with many others. Of course, changing these messages could change the elaboration order for the program, or worse, create a situation where no workable elaboration order existed. If this check was static, there was no way to find and remove this emergent property of the program other than to backtrack. This was no help to the guy trying to get the initialization code of a large system to work. He was MUCH happier getting -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...