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.9 required=5.0 tests=BAYES_00 autolearn=unavailable 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!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Everything You Know Is Wrong Date: Tue, 29 Dec 2015 18:36:40 +0100 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: LNA1TkTuMxfwTHzeJdi6nA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:28926 Date: 2015-12-29T18:36:40+01:00 List-Id: 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. The job is done! > 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. Ada mandates B initialized after A. Again, the "optimization" you wanted is done. BTW, why do you believe that the same amount of computation performed consecutively should require less energy or (not quite same) less battery drain? It is no obvious. In any case it might depend on the specifics of the battery, the board, the memory controller, the number of cores etc. You cannot optimize for these, it would lead a combinatoric explosion of targets. All that mess to save 0.1% drain? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de