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: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Why *.adb and *.ads? Date: Mon, 1 Jan 2018 22:00:48 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 1 Jan 2018 21:00:50 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="54946e3a4feaeb3b428cadc172e97c88"; logging-data="26030"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/bigjd5ygB184lBkY55WP2MCCNBpE1xzo=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 In-Reply-To: Content-Language: en-US Cancel-Lock: sha1:CrglAMYT81ZpDdXyNJGOfxarryM= Xref: reader02.eternal-september.org comp.lang.ada:49716 Date: 2018-01-01T22:00:48+01:00 List-Id: On 01/01/2018 09:15 PM, Andrew Shvets wrote: > I'm curious, why do the source files in Ada have the file endings of *.ads and *.adb? Is there a reason for this? Or any background story? They don't. There are no source files in Ada. The ARM talks about the text of a compilation, which is divided into lines by line terminators, since comments are terminated by line terminators. But it says nothing about source files or file names. It is normal on most computer systems for the text of a compilation to be in a file, but this is not required by the standard. Ada-83 compilers reequired, and many compilers for later versions of the language used, the concept of a compilation library. One of the purposes of this was to associate Ada unit names with file names. On such systems, a source file could have any name at all. One instructed the compilation library to associate one or more Ada units with a file name, and then the compilation system knew where to find those units. Some of those systems had recommended file-naming techniques. Rational liked name.1.ada for specs and name.2.ada for bodies. Janus/Ada recommends .pkg for packages. Others liked things like name.ada for specs and name_b.ada for bodies. Beginning with Ada 95, the standard no longer required the use of a compilation library. GNAT decided not to use one, and instead to associate units with files through default file-naming rules. They chose name.ads for specs and name.adb for everything else. There are ways to use other file names, but in general it's usually easiest to go along with the default names. -- Jeff Carter "If you think you got a nasty taunting this time, you ain't heard nothing yet!" Monty Python and the Holy Grail 23