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=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ab1d177a5a26577d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.38.38 with SMTP id d6mr14375364pbk.4.1318063140581; Sat, 08 Oct 2011 01:39:00 -0700 (PDT) Path: lh7ni14177pbb.0!nntp.google.com!news1.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: What's wrong with C++? Date: Sat, 08 Oct 2011 10:39:21 +0200 Organization: Tidorum Ltd Message-ID: <9fagh0F65lU1@mid.individual.net> References: <1ee1a434-4048-48f6-9f5e-d8126bebb808@r19g2000prm.googlegroups.com> <9f27b2FsgsU1@mid.individual.net> Mime-Version: 1.0 X-Trace: individual.net ajTuUrTQaISI5DSI3liPXgZkcie0LEUkAw2+L0a4FUrpwZ3O5m Cancel-Lock: sha1:I/ecVNG9yfk8wLlfadcVLjivzJs= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 In-Reply-To: Xref: news1.google.com comp.lang.ada:18350 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Date: 2011-10-08T10:39:21+02:00 List-Id: On 11-10-08 03:36 , Randy Brukardt wrote: > "Yannick Duch�ne (Hibou57)" wrote in message > news:op.v2u8hzeyule2fv@index.ici... >> e Wed, 05 Oct 2011 07:13:16 +0200, Niklas Holsti >> a �crit: >>> Doesn't Ada have a similar theoretical problem with the elaboration >>> order? I seem to remember that finding a valid elaboration order for an >>> arbitrary Ada program is rather difficult, in general, and compilers are >>> allowed to give up on it. >> I am not aware enough of the techniques used there, and not a compiler >> implementor, but I guess this is a divide-and-conquer strategy. I suppose >> this end to be solving a graph route problem, not a Turing complete >> language interpretation. >> >> You raised a good question anyway, I'm curious to know (may be an answer >> in some GNAT design papers, or some answers from Randy). > > I implemented that a long, long time ago, and haven't had to fix anything in > it in a long time,... [snip] > I don't know of any real problem with elaboration given the Ada rules; the > usual problem comes when someone tries to change those rules from dynamic to > static rules (as GNAT does). Janus/Ada doesn't attempt that. Thanks for your explanation, Randy. I think the problem I remembered was to find an elaboration order such that the program would be certain not to call a non-elaborated subprogram, that is, that it would not raise Program_Error because of a failed Elaboration_Check (LRM 3.11). So it requires more than finding an order that is valid according to the LRM dependency rules. Having now re-read some of the GNAT User Guide chapter on elaboration, my understanding is that in general such an elaboration order may not exist, and it is unsolvable to decide if it exist, and unsolvable to find it, if it does exist. But if you follow the static rules suggested in the GNAT UG, the compiler either finds a such an order, or tells you why it can't. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .