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, MSGID_RANDY 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 Dewar Subject: Re: generic package dilemma Date: 1999/12/03 Message-ID: <828mu3$8i0$1@nnrp1.deja.com>#1/1 X-Deja-AN: 555994525 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> <81cru4$url$1@nnrp1.deja.com> <38464A8F.FDE762F9@mail.com> X-Http-Proxy: 1.0 x22.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Fri Dec 03 15:17:27 1999 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-12-03T00:00:00+00:00 List-Id: In article <38464A8F.FDE762F9@mail.com>, Mats Weber wrote: > That is just what I did in my thesis There are a number of other explorations of this idea (basically the idea of tracing all possible static flows through a program). In particular, there was an exploration of this idea during the Ada 83 design, and if I remember, a corresponding LSN, and also more recently some work at Binghamton and a published paper. The difficulty is that it is probably not practical to mandate this kind of program wide analysis as a standard feature of all compilers. The GNAT approach, by contrast, can be simply done on a unit by unit basis (static tracing occurs only within a unit), and the approach for inter-unit analysis corresponds in a simple manner to good Ada coding practice (the fundamental principle that a client of a package should rely only on the spec, and not on detailed knowledge of the structure or code of the body). The trouble with this general tracing schemes is that they can still leave you in a situation where your program compiles and runs, and then you change something in a body, and the program no longer compiles because some client somewhere was making elaboration related assumptions about the contents of this body. Of course a compiler that did the full tracing would do a much better job in the fully dynamic case of finding a workable elaboration order, but that's a mixed blessing. The trouble is that if the compiler finds this order for you, then your program may be seriously non-portable and you don't realize it (until you try to port to another system). In fact in GNAT we provide the -p (pessimistic elaboration order) option for the binder. This option is relevant only if you are using fully dynamic elaboration (compiling with the -gnatE switch), and it causes the binder to choose what it thinks is the WORST possible elaboration order, to help smoke out such lurking bugs :-) Robert Dewar Ada Core Technologies Sent via Deja.com http://www.deja.com/ Before you buy.