comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Why *.adb and *.ads?
Date: Mon, 1 Jan 2018 22:00:48 +0100
Date: 2018-01-01T22:00:48+01:00	[thread overview]
Message-ID: <p2e7i2$pde$1@dont-email.me> (raw)
In-Reply-To: <ef3c5e22-3f43-473a-9852-232d4196ba2a@googlegroups.com>

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

  reply	other threads:[~2018-01-01 21:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-01 20:15 Why *.adb and *.ads? Andrew Shvets
2018-01-01 21:00 ` Jeffrey R. Carter [this message]
2018-01-02  1:50   ` Mace Ayres
2018-01-02  1:27 ` Mace Ayres
2018-01-27 15:45 ` Norman Worth
2018-01-27 16:37   ` Dennis Lee Bieber
2018-01-27 22:18     ` [OT] VMS editors and PC keyboards, was: " Simon Clubley
2018-01-27 16:40   ` Mace Ayres
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox