From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Why .ads as well as .adb?
Date: Wed, 5 Jun 2019 13:11:28 +0300
Date: 2019-06-05T13:11:28+03:00 [thread overview]
Message-ID: <glpiqeFt9jqU1@mid.individual.net> (raw)
In-Reply-To: <87woi0xtwm.fsf@nightsong.com>
On 19-06-05 12:28 , Paul Rubin wrote:
> "J-P. Rosen" <rosen@adalog.fr> writes:
>> Yes, Ada favors readability over writability.
>
> I find when trying to study a codebase, having the code spread across
> too many files seriously impairs readability. That problem is worst
> with Java, which puts each class (even small ones) in a separate file.
On the other hand, I like it that I can get a first impression of an Ada
program by reading just the .ads files.
> ML also does have a separate specification languate (the "module
> language") and implementation language, I mean really, not like the
> crappy .h system of C++. But I think it is ok (i.e. acceptable though
> not universal practice in ML) to put both the interface spec and the
> implementation in the same file. I don't see what is wrong with the
> idea of doing the same thing in Ada.
Apart from all the other reasons already given, keeping spec and body in
the same file can cause compilation-order problems. Suppose that there
are two packages, A and B, such that the specs do not depend on each
other but the bodies do. That is, the body of A has "with B" (which
really means, "with the spec of B") and the body of B has "with A"
(which really means, "with the spec of A"). If the spec and body of A
are both in one and the same file, and the spec and body of B are both
in another file, when the compiler processes a "with" clause it would
have to be able to read, parse and use only the spec part of the
"withed" file, while ignoring the body part (because it depends on a
spec not yet seen).
I admit that this kind of mutual dependence between packages is often
frowned on (because it breaks architectural "layering") but I find it
hard to completely avoid it.
--
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
. @ .
next prev parent reply other threads:[~2019-06-05 10:11 UTC|newest]
Thread overview: 88+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-02 0:48 Why .ads as well as .adb? John Perry
2019-06-02 5:42 ` J-P. Rosen
2019-06-02 6:39 ` Dmitry A. Kazakov
2019-06-03 7:35 ` Maciej Sobczak
2019-06-03 7:57 ` J-P. Rosen
2019-06-03 19:49 ` Keith Thompson
2019-06-04 8:03 ` Maciej Sobczak
2019-06-03 8:13 ` Dmitry A. Kazakov
2019-06-03 19:51 ` Keith Thompson
2019-06-03 20:18 ` Dmitry A. Kazakov
2019-06-04 8:24 ` Maciej Sobczak
2019-06-04 9:33 ` Dmitry A. Kazakov
2019-06-05 9:04 ` Maciej Sobczak
2019-06-05 12:48 ` Dmitry A. Kazakov
2019-06-05 17:12 ` G. B.
2019-06-05 18:50 ` Optikos
2019-06-05 22:57 ` Randy Brukardt
2019-06-04 22:28 ` Randy Brukardt
2019-06-05 8:28 ` Maciej Sobczak
2019-06-05 9:20 ` J-P. Rosen
2019-06-05 9:28 ` Paul Rubin
2019-06-05 10:11 ` Niklas Holsti [this message]
2019-06-05 12:58 ` Maciej Sobczak
2019-06-05 14:28 ` Niklas Holsti
2019-06-06 7:34 ` Maciej Sobczak
2019-06-06 19:51 ` Keith Thompson
2019-06-06 20:27 ` J-P. Rosen
2019-06-06 21:12 ` Randy Brukardt
2019-06-06 21:17 ` Randy Brukardt
2019-06-06 22:08 ` Dennis Lee Bieber
2019-06-07 7:59 ` Maciej Sobczak
2019-06-07 10:42 ` alby.gamper
2019-06-07 16:59 ` Dennis Lee Bieber
2019-06-07 14:10 ` Brad Moore
2019-06-07 23:37 ` Paul Rubin
2019-06-08 1:16 ` Brad Moore
2019-06-08 7:34 ` Simon Wright
2019-06-08 17:44 ` G.B.
2019-06-08 21:41 ` Keith Thompson
2019-06-09 0:40 ` Paul Rubin
2019-06-09 18:56 ` Keith Thompson
2019-06-09 20:35 ` John Perry
2019-06-09 21:15 ` Niklas Holsti
2019-06-09 22:37 ` John Perry
2019-06-10 9:01 ` Simon Wright
2019-06-10 13:15 ` Simon Wright
2019-06-10 9:22 ` Niklas Holsti
2019-06-09 21:37 ` Simon Wright
2019-06-09 22:40 ` John Perry
2019-06-10 9:07 ` Simon Wright
2019-06-09 21:46 ` Niklas Holsti
2019-06-10 17:11 ` Dennis Lee Bieber
2019-06-08 4:57 ` Randy Brukardt
2019-06-08 23:57 ` Optikos
2019-06-09 0:43 ` Paul Rubin
2019-06-10 8:17 ` Maciej Sobczak
2019-06-10 19:10 ` G.B.
2019-06-10 22:07 ` Randy Brukardt
2019-06-11 0:32 ` Optikos
2019-06-11 15:39 ` Brad Moore
2019-06-11 16:14 ` John Perry
2019-06-11 16:46 ` Shark8
2019-06-11 19:29 ` John Perry
2019-06-14 6:12 ` Brad Moore
2019-06-14 21:51 ` John Perry
2019-06-14 16:29 ` djakoogler
2019-06-11 18:19 ` joakimds
2019-06-11 15:49 ` Jeffrey R. Carter
2019-06-07 7:36 ` Niklas Holsti
2019-06-05 22:41 ` Randy Brukardt
2019-06-06 3:34 ` Keith Thompson
2019-06-06 7:29 ` Maciej Sobczak
2019-06-06 15:30 ` John Perry
2019-06-06 15:41 ` Brad Moore
2019-06-06 19:42 ` Keith Thompson
2019-06-06 16:37 ` Dennis Lee Bieber
2019-06-02 9:59 ` joakimds
2019-06-02 20:14 ` G.B.
2019-06-03 13:37 ` John Perry
2019-06-03 14:50 ` Niklas Holsti
2019-06-03 19:23 ` John Perry
2019-06-03 21:04 ` Niklas Holsti
2019-06-03 18:51 ` Lucretia
2019-06-03 19:32 ` John Perry
2019-06-03 17:00 ` Jeffrey R. Carter
2019-06-03 18:59 ` Lucretia
2019-06-03 19:29 ` John Perry
2019-06-03 20:00 ` Jeffrey R. Carter
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox