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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: Everything You Know Is Wrong Date: Tue, 29 Dec 2015 18:53:58 +0100 Organization: A noiseless patient Spider Message-ID: References: Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 29 Dec 2015 17:51:22 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="b96887e80893c84a90c3007226ca0d1c"; logging-data="12849"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+TBLrQYnN2Wl0cUbxn89QTDEufjt54K10=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 In-Reply-To: Cancel-Lock: sha1:fMI5fmc54AC+df+6szg4crUx75U= Xref: news.eternal-september.org comp.lang.ada:28927 Date: 2015-12-29T18:53:58+01:00 List-Id: On 29.12.15 18:36, Dmitry A. Kazakov wrote: > On 2015-12-29 17:57, G.B. wrote: > >> The point is that, since order does not matter among these parallel >> computations, and since parallel loops are not just fantasy, >> the possibility of postponement follows from parallel loops. > > Ada does not have parallel loops. Ada is about to have parallel loops. Ada compilers already produce code for parallel execution of loop bodies on today's processors. >> Consider F1 and F2 from a Pure package, X a variable of type T >> and T without progenitors: >> >> declare >> A : T := F1 (1,2,3); >> B : T := F2 (X); >> begin >> G (A, B); >> end; >> >> Is it impossible for a compiler to see that the initializing parts of >> the declarations of A and B are independent? > > No, because initialization of T may have side effects. I assume you meant Yes, impossible. But, if F1 and F2 are from a Pure package, is the compiler allowed to ignore side effects because the programmer specified Pure? I think that follows. > BTW, why do you believe that the same amount of computation performed > consecutively should require less energy or (not quite same) less > battery drain? Less energy at a certain point in time. Postpone calling sub if, say, a photocell should first be given time to recharge a battery while while regular operation continues, then call sub.