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!feeder.eternal-september.org!news.unit0.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: How to get Ada to ?cross the chasm?? Date: Fri, 11 May 2018 11:43:33 +0300 Organization: Tidorum Ltd Message-ID: References: <87h8no1nli.fsf@nightsong.com> <874ljo1hvy.fsf@nightsong.com> <87vac4z2lh.fsf@nightsong.com> <87lgcszjdn.fsf@nightsong.com> <87sh6z1kkg.fsf@nightsong.com> <87k1sb1dt3.fsf@nightsong.com> <87d0y3ys2g.fsf@nightsong.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net A+PP/IrmFcvJVVkNkYRn6gIDmOCdsrOkqZXxqZhKFwYmGbRosp Cancel-Lock: sha1:KfyoN4SSSNvgqX4Y3YefZkwCZb4= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: <87d0y3ys2g.fsf@nightsong.com> Xref: reader02.eternal-september.org comp.lang.ada:52255 Date: 2018-05-11T11:43:33+03:00 List-Id: On 18-05-11 03:05 , Paul Rubin wrote: > I've on the other hand seen it claimed that Ada was (my interpretation) > rescued from oblivion by none other than Richard Stallman, who freaked > out at the proposal to make GNAT part of the GNU project, because Ada as > then envisioned couldn't accomodate separate compilation. Ada has always allowed separate compilation. In the early days of Ada 83 compilation could be so slow that rebuilding a whole, large program could take a week. Separate compilation was essential. Some Ada environments (Rational) almost insisted on separate compilation of each subprogram, let alone each package. The issue with Stallman, GNAT and GNU was on the practicalities of adapting the GCC compilation model to Ada in a way that also satisfies the Ada rules on _when_ an Ada module must be recompiled. > Jean Ichbiah had instead decided there had to be a library of compiled > packages that the compiler had to access while compiling, IAUI this was a DoD requirement for Ada. The central point of the library was that separate compilation should not let one circumvent the language rules (dependencies, consistency, etc.), whether by mistake or on purpose. > which made the order in which separate modules were compiled critical. The natural order: if module A depends on the (interface of) module B, then the (interface of) module B must be compiled before module A. In other words, if (the interface of) module B changes, then module A must be recompiled before the program is linked. The Ada library broke the GCC principle that every source-code file (.c) is compiled into an object file (.o), and so broke the principles on which "make" operates (by incorporating the dependency-tracking into the library). The library-based Ada compilers were certainly practical for Ada programming, and most of them had a tool to suggest a compilation order, similar to "make". But inter-language "make" was complicated. > After discussions with > Stallman, Bob Dewar then came up with a way to allow Ada packages to be > compiled separately from each other, Separate compilation was possible before; what was invented was a way to avoid implementing the Ada library concretely as some kind of database of the compiled modules. The idea in the GNAT "source-based library" is to view the set of Ada _source code_ files as the "Ada library", and implement "with" in the same way as "#include": the withed declarations are (re-)compiled on the fly when the withing unit is compiled. The penalty for such recompilation is smaller today, with faster machines and compilers. Then every source-code module (.ads and .adb pair, plus possible separate subunits) is compiled into its own object file (.o). The compiler further tracks dependencies in the "Ada library information" files (.ali) files, which (in a sense) correspond to the dependency files that can be automatically generated from a C compilation and translated into "make" dependencies. > and everyone uses that scheme today. Some do, some don't. Certainly the source-based library makes compiling Ada programs more similar to the process for other languages and so helps novices start with Ada. It's interesting and somehow paradoxical that many C/C++ programming systems implement "precompiled headers" to avoid the recompilation of the header files for each "#include". A C/C++ system with precompiled headers is implementing a "C library" similar to the original "Ada library", although better hidden from the users. Moreover, I recall that in some C++ compilers it was important to compile templates in a particular order, but perhaps this problem has been solved now, with the better standardisation of templates. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .