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!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Teaching C/C++ from Ada perspective? Date: Wed, 04 Jul 2018 17:01:07 +0100 Organization: A noiseless patient Spider Message-ID: References: <856189aa-fa00-4960-929e-174f352310ad@googlegroups.com> <2718c8d4-5f35-4fd8-a1aa-1e60069a7a5d@googlegroups.com> <39fce60c-9f56-42fb-b679-fa08810b00ee@googlegroups.com> <3701bf07-89a5-4cb0-a704-5aebb589ca79@googlegroups.com> <2f5e4ce0-94e8-4b94-9da7-045ec90a9b22@googlegroups.com> <18554067-1382-4b43-a832-2d27aa5117d7@googlegroups.com> <8dc19505-b68a-403c-a164-f1de1864f3f1@googlegroups.com> <559657f8-bbf4-4a70-9449-f85bc98d6c6b@googlegroups.com> <590d4672-4aef-42a5-823c-57ccd291115a@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="a335f6f9fb05a339d6757f06e9cb9b03"; logging-data="3274"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186xuTbnWLQUht4fk/H29PwsjqhxRZiL84=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:MiyNwPoIJ0PyrAiSHmMQcK8AQOE= sha1:imIkjEj8i0k+gviWw29YenLsUxA= Xref: reader02.eternal-september.org comp.lang.ada:53599 Date: 2018-07-04T17:01:07+01:00 List-Id: Maciej Sobczak writes: >> > Yet, the trivial update of P (like adding whitespace, which again has >> > no semantic meaning whatsoever) forces the recompilation of Test (with >> > GNAT). Actually, it forces the recompilation of everything. Why? >> >> gprbuild: >> -m Minimum Ada recompilation >> >> Only rebuild if there's a semantic difference > > Great! Let's try it out. > I have added a dummy declaration to P, like here: > > -- p.ads: > package P is > pragma Pure (P); > type TI is new Integer; -- new dummy definition > end P; > > and... the whole project was recompiled from scratch. > > No other part of the project relies on this new type and in > particular, the author of Test still could not care less about package > P and whatever it contains. > Yet, the author of Test had to wait for the whole project to > recompile, because something irrelevant was added to some irrelevant > package that he might not even know that exists in the project. > > I presume that the -m switch was supposed to handle a trivial (and > perhaps frequent) case of editing comments and whitespace. There is > some added value in this, but it is easy to replicate for C++ and > sorry, but I don't call it "semantic" if it cannot figure out even the > most basic cases like the one above. I think we'll have to agree to differ on what "semantic" means, then. > My claim that Ada and C++ compilers have the same challenges when it > comes to handling the physical project structure holds. Indeed.