comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Belmont <sbelmont700@gmail.com>
Subject: Re: Ada Pure or Preelaborate or ? in Adare_net
Date: Mon, 3 Jan 2022 17:11:36 -0800 (PST)	[thread overview]
Message-ID: <15ffbb15-6f0b-4f61-8740-f100d9e384bbn@googlegroups.com> (raw)
In-Reply-To: <3b7ba153-ebf1-4b85-a1b2-3ad5aaeca11en@googlegroups.com>

On Friday, December 31, 2021 at 11:13:33 AM UTC-5, daniel...@gmail.com wrote:
> Hi! 
> 
> I and a friend created an Ada network lib where, 
> from the begining, we tried very hard to make It a Ada Pure. 
> 
> From the examples dir, the lib worked as expected (in gcc-10.2 gcc-11.2 and gcc-12). 
> To our surprise, what most caught the attention of the group's friends was the fact that the lib was Ada Pure and if that was correct. 
> 
> For this reason, if really 'is' pure, not pure, preelaborate or what (?), pleeeeeeaaase, we ask the group's Ada Language Lawyers to help analyze and suggest modifications if necessary. 
> 
> link: https://gitlab.com/daresoft/network/adare_net/-/tree/202x 
> for Ada version use 2012 and or 202x. 
> 
> Best Wishes and Happy New Year, 
> Dani.

It seems to be mostly just a thin binding to a bunch of C functions, so the applicability of any Ada feature is mostly a moot point. The Ada compiler has no control or visibility into the C domain, so while on the one hand your packages are technically Pure, on the other hand the C functions can violate those "purity rules" all they want, which might be misleading to users expecting otherwise.  You don't use 'Unchecked_Access either, but obviously that doesn't mean the C functions are somehow prevented from creating dangling pointers.  Personally, I would have the interfaces reflect the reality of the actual behavior (which in the case of C code you don't control, is usually assume-the-worst).

-sb


  reply	other threads:[~2022-01-04  1:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-31 16:13 Ada Pure or Preelaborate or ? in Adare_net Daniel Norte Moraes
2022-01-04  1:11 ` Simon Belmont [this message]
2022-01-05 16:11   ` Daniel Norte Moraes
2022-01-04 13:52 ` Fabien Chouteau
2022-01-05 16:33   ` Daniel Norte Moraes
2022-01-05 23:40     ` Randy Brukardt
2022-01-06 20:39       ` Daniel Norte Moraes
replies disabled

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