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!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Intervention needed? Date: Fri, 22 Mar 2019 15:09:36 +0100 Organization: Adalog Message-ID: References: <5fb80936-f660-47dd-9cf5-73d35406782f@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 22 Mar 2019 14:09:37 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="28701c96b18acc2521063831159cef79"; logging-data="10688"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19z8TZvjJnBxF27nEFwaecI" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0 Cancel-Lock: sha1:vDqK/HbinlY6e/vWb1Z0bgwYfIM= In-Reply-To: <5fb80936-f660-47dd-9cf5-73d35406782f@googlegroups.com> Content-Language: fr Xref: reader01.eternal-september.org comp.lang.ada:55930 Date: 2019-03-22T15:09:36+01:00 List-Id: Le 22/03/2019 à 12:10, Lucretia a écrit : > See in: https://users.rust-lang.org/t/if-ada-is-already-very-safe-why-rust/21911/47 > >> He also told me that Ada compilers aren’t allowed to do certain kinds of optimizations that for example c, c++ (and Rust and other PL via LLVM) are doing. > > How true is this? > In Ada, the principle is that the compiler has an obligation of result, i.e. that the "external effect" (see 1.1.3(9)) of the compiled program must be the same as the effect defined by the canonical execution. Basically, this means that the compiler can do any optimization provided the result is correct. Going farther than that would mean allowing the compiler to generate incorrect programs... Maybe that's what C/C++ compilers are doing ;-) -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr