comp.lang.ada
 help / color / mirror / Atom feed
* Project files ads/adb organization
@ 2016-12-15 14:40 Alejandro R. Mosteo
  2016-12-15 20:31 ` Niklas Holsti
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Alejandro R. Mosteo @ 2016-12-15 14:40 UTC (permalink / raw)


I'm overthinking how to organize a library source and have come to this 
idea (Gnat-specific due to ads/adb files):

- An /spec/ folder with ads files exposing the client interface.
- An /priv/ folder with ads files for support packages, not intended for 
direct client use.
- A /body/ folder for all the bodies.

A variant could be to separate public spec from bodies, but keep private 
parts together.

I wonder if the idea of separating specs from their bodies could be seen 
as a poor choice. Certainly it requires developers to use an Ada-aware 
editor like GPS, but for clients seems appropriate not to mix things 
they don't need to see.

Opinions? Or "whatever floats your boat?"

Cheers,
Álex.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Project files ads/adb organization
  2016-12-15 14:40 Project files ads/adb organization Alejandro R. Mosteo
@ 2016-12-15 20:31 ` Niklas Holsti
  2016-12-15 22:30 ` Randy Brukardt
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Niklas Holsti @ 2016-12-15 20:31 UTC (permalink / raw)


On 16-12-15 16:40 , Alejandro R. Mosteo wrote:
> I'm overthinking how to organize a library source and have come to this
> idea (Gnat-specific due to ads/adb files):
>
> - An /spec/ folder with ads files exposing the client interface.
> - An /priv/ folder with ads files for support packages, not intended for
> direct client use.
> - A /body/ folder for all the bodies.
>
> A variant could be to separate public spec from bodies, but keep private
> parts together.
>
> I wonder if the idea of separating specs from their bodies could be seen
> as a poor choice. Certainly it requires developers to use an Ada-aware
> editor like GPS, but for clients seems appropriate not to mix things
> they don't need to see.
>
> Opinions? Or "whatever floats your boat?"

I don't see any benefit in separating declarations from bodies "on 
principle". For me to do that, there would have to be some other reason 
for such a separation.

I tend to put all sources (.ads and .adb) in one and the same folder, to 
be able to "grep" and use other command-line tools easily.

I use folders for the following purposes:

- separating more or less independent source-code sets, for example 
different programs (executables) which share some code (common folder), 
but also have some program-specific code (program-specific folders)

- separating different versions of packages, for example a package with 
a portable, standard declaration in one folder, but specific bodies for 
Linux and Windows, in separate "linux" and "windows" folders, with 
different GPR files or build scripts to select the versions for a 
particular build.

Some of my colleagues like to divide application source code into 
folders according to the functional divions of the application, for 
emxaple a "user interface" folder, a "database interface" folder, a 
"computations" folder, and so on. I prefer not to do that, but to rely 
on the package hierarchy or other package-and-file naming conventions to 
group files according to function.

So whatever floats...

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Project files ads/adb organization
  2016-12-15 14:40 Project files ads/adb organization Alejandro R. Mosteo
  2016-12-15 20:31 ` Niklas Holsti
@ 2016-12-15 22:30 ` Randy Brukardt
  2016-12-16 12:46 ` Alejandro R. Mosteo
  2016-12-16 14:48 ` Egil H H
  3 siblings, 0 replies; 6+ messages in thread
From: Randy Brukardt @ 2016-12-15 22:30 UTC (permalink / raw)


"Alejandro R. Mosteo" <alejandro@mosteo.com> wrote in message 
news:o2u9tf$9j0$1@dont-email.me...
> I'm overthinking how to organize a library source and have come to this 
> idea (Gnat-specific due to ads/adb files):
>
> - An /spec/ folder with ads files exposing the client interface.
> - An /priv/ folder with ads files for support packages, not intended for 
> direct client use.
> - A /body/ folder for all the bodies.
>
> A variant could be to separate public spec from bodies, but keep private 
> parts together.
>
> I wonder if the idea of separating specs from their bodies could be seen 
> as a poor choice. Certainly it requires developers to use an Ada-aware 
> editor like GPS, but for clients seems appropriate not to mix things they 
> don't need to see.
>
> Opinions? Or "whatever floats your boat?"

I don't think its necessarily "overthinking". For the Janus/Ada runtime, we 
only provide the specifications in the non-embedded packages (don't support 
recompiling the runtime for those). Usually, that's all you need.

For Claw, we just provided it in one bunch, but there aren't very many 
private packages, so almost every .ads is a public specification.

I'd suggest not making it too complicated, but  some sort of separation of 
"public" stuff that clients are supposed to use, and the rest of it, seems 
reasonable.

                          Randy.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Project files ads/adb organization
  2016-12-15 14:40 Project files ads/adb organization Alejandro R. Mosteo
  2016-12-15 20:31 ` Niklas Holsti
  2016-12-15 22:30 ` Randy Brukardt
@ 2016-12-16 12:46 ` Alejandro R. Mosteo
  2016-12-16 14:48 ` Egil H H
  3 siblings, 0 replies; 6+ messages in thread
From: Alejandro R. Mosteo @ 2016-12-16 12:46 UTC (permalink / raw)


On 15/12/16 15:40, Alejandro R. Mosteo wrote:
> I'm overthinking how to organize a library source and have come to this
> idea (Gnat-specific due to ads/adb files):

> Opinions? Or "whatever floats your boat?"

Thanks Niklas and Randy for your opinions.

>
> Cheers,
> Álex.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Project files ads/adb organization
  2016-12-15 14:40 Project files ads/adb organization Alejandro R. Mosteo
                   ` (2 preceding siblings ...)
  2016-12-16 12:46 ` Alejandro R. Mosteo
@ 2016-12-16 14:48 ` Egil H H
  2016-12-19  9:40   ` Alejandro R. Mosteo
  3 siblings, 1 reply; 6+ messages in thread
From: Egil H H @ 2016-12-16 14:48 UTC (permalink / raw)


On Thursday, December 15, 2016 at 3:40:04 PM UTC+1, Alejandro R. Mosteo wrote:
> 
Since you're already using Gnat, have you looked at GPRInstall?
It will allow you to expose only API-specs in the install dir for library projects


-- 
~egilhh

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Project files ads/adb organization
  2016-12-16 14:48 ` Egil H H
@ 2016-12-19  9:40   ` Alejandro R. Mosteo
  0 siblings, 0 replies; 6+ messages in thread
From: Alejandro R. Mosteo @ 2016-12-19  9:40 UTC (permalink / raw)


On 16/12/16 15:48, Egil H H wrote:
> On Thursday, December 15, 2016 at 3:40:04 PM UTC+1, Alejandro R. Mosteo wrote:
>>
> Since you're already using Gnat, have you looked at GPRInstall?
> It will allow you to expose only API-specs in the install dir for library projects

Thanks for the pointer, I will keep it in mind for installation scripts. 
At this time I am more concerned with github-like distribution only.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-12-19  9:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-15 14:40 Project files ads/adb organization Alejandro R. Mosteo
2016-12-15 20:31 ` Niklas Holsti
2016-12-15 22:30 ` Randy Brukardt
2016-12-16 12:46 ` Alejandro R. Mosteo
2016-12-16 14:48 ` Egil H H
2016-12-19  9:40   ` Alejandro R. Mosteo

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