Hi All! :-)
Adare_net is a small, portable and easy to use Ada network lib.
It supports ipv4 ipv6 udp and tcp, and can 'listen' with ipv6, too.
The powerfull buffer feature can support all Ada types,
and with a more refined treatment, you can use endian proof records and unconstrained arrays.
From now, tested and working:
AMD64 :
mswindows 7 sp1 64bits
and ubuntu Hirsute 64bits
Thanks and Enjoy!!
https://gitlab.com/daresoft/network/adare_net
I had a quick look at the top level source code. I'm surprised all
packages are declared with "pure" aspect.
From what I understand of the "pure" aspect, these packages are not pure.
Am I wrong ?
Regards,
Nicolas
I agree with you Nicolas, they should not be declared Pure. It makes the GNAT compiler check for example that there are no global variables used in the packages but other than that, they (I didn't check all the packages) are not Pure. The pragma Pureworked as expected in Ada83 but the meaning and utility of it disappeared with the Ada95 standard.
worked as expected in Ada83 but the meaning and utility of it disappeared with the Ada95 standard.I agree with you Nicolas, they should not be declared Pure. It makes the GNAT compiler check for example that there are no global variables used in the packages but other than that, they (I didn't check all the packages) are not Pure. The pragma Pure
There is no pragma Pure in Ada 83.
onsdag 22 september 2021 kl. 11:16:13 UTC+2 skrev AdaMagica:Pure worked as expected in Ada83 but the meaning and utility of it disappeared with the Ada95 standard.
I agree with you Nicolas, they should not be declared Pure. It makes the GNAT compiler check for example that there are no global variables used in the packages but other than that, they (I didn't check all the packages) are not Pure. The pragma
There is no pragma Pure in Ada 83.Thanks for clearing that up AdaMagica, I wasn't aware.
Best regards,
Joakim
I agree with you Nicolas, they should not be declared Pure. It makes the
GNAT compiler
check for example that there are no global variables used in the packages
but other than
that, they (I didn't check all the packages) are not Pure. The pragma
Pure worked as
expected in Ada83 but the meaning and utility of it disappeared with the
Ada95 standard.
There is no pragma Pure in Ada 83.
Em quarta-feira, 22 de setembro de 2021 Ã s 08:07:06 UTC-3, joak...@kth.se escreveu:Pure worked as expected in Ada83 but the meaning and utility of it disappeared with the Ada95 standard.
onsdag 22 september 2021 kl. 11:16:13 UTC+2 skrev AdaMagica:
I agree with you Nicolas, they should not be declared Pure. It makes the GNAT compiler check for example that there are no global variables used in the packages but other than that, they (I didn't check all the packages) are not Pure. The pragma
There is no pragma Pure in Ada 83.Thanks for clearing that up AdaMagica, I wasn't aware.
Best regards,
Joakim
Really? They _are_ Pure.
I used linters extensively to result in this. one of these linters made hard use o gnat and gprbuild as his backend.
Remember this is target Ada 2012 (update 2016) and beyond => there is
no guarantee of operation for Ada versions earlier than Ada2012.
for now Adare_Net support:
MSwindows and Linux.
was tested in:
Mswindows => starting amd64 windows seven sp1 + msys2 gcc-10.3 gnat-10.3 gprbuild-2021
Linux => amd64 gcc-11.1+ gnat-11.1+ gprbuild-2021.
1o.) We need as many volunteers as possible to testing Adare_Net on as many
operating systems as possible and reporting his/her result to us.
currently linux and mswindows are the targets.
Very Very Very Thanks!
Enjoy!!!
Le 27/09/2021 à 06:32, Daniel Norte Moraes a écrit :Pure worked as expected in Ada83 but the meaning and utility of it disappeared with the Ada95 standard.
Em quarta-feira, 22 de setembro de 2021 Ã s 08:07:06 UTC-3, joak...@kth.se escreveu:
onsdag 22 september 2021 kl. 11:16:13 UTC+2 skrev AdaMagica:
I agree with you Nicolas, they should not be declared Pure. It makes the GNAT compiler check for example that there are no global variables used in the packages but other than that, they (I didn't check all the packages) are not Pure. The pragma
There is no pragma Pure in Ada 83.Thanks for clearing that up AdaMagica, I wasn't aware.
Best regards,
Joakim
Really? They _are_ Pure.In a Pure package, shouldn't the subprograms also be Pure ?
I used linters extensively to result in this. one of these linters made hard use o gnat and gprbuild as his backend.
Remember this is target Ada 2012 (update 2016) and beyond => there is
no guarantee of operation for Ada versions earlier than Ada2012.
for now Adare_Net support:
MSwindows and Linux.
was tested in:
Mswindows => starting amd64 windows seven sp1 + msys2 gcc-10.3 gnat-10.3 gprbuild-2021
Linux => amd64 gcc-11.1+ gnat-11.1+ gprbuild-2021.
1o.) We need as many volunteers as possible to testing Adare_Net on as many
operating systems as possible and reporting his/her result to us. currently linux and mswindows are the targets.
Very Very Very Thanks!
Enjoy!!!
Em quinta-feira, 30 de setembro de 2021 Ã s 09:24:34 UTC-3, DrPi escreveu:Pure worked as expected in Ada83 but the meaning and utility of it disappeared with the Ada95 standard.
Le 27/09/2021 à 06:32, Daniel Norte Moraes a écrit :
Em quarta-feira, 22 de setembro de 2021 Ã s 08:07:06 UTC-3, joak...@kth.se escreveu:
onsdag 22 september 2021 kl. 11:16:13 UTC+2 skrev AdaMagica:
I agree with you Nicolas, they should not be declared Pure. It makes the GNAT compiler check for example that there are no global variables used in the packages but other than that, they (I didn't check all the packages) are not Pure. The pragma
In a Pure package, shouldn't the subprograms also be Pure ?There is no pragma Pure in Ada 83.Thanks for clearing that up AdaMagica, I wasn't aware.
Best regards,
Joakim
Really? They _are_ Pure.
I used linters extensively to result in this. one of these linters made hard use o gnat and gprbuild as his backend.
Remember this is target Ada 2012 (update 2016) and beyond => there is
no guarantee of operation for Ada versions earlier than Ada2012.
for now Adare_Net support:
MSwindows and Linux.
was tested in:
Mswindows => starting amd64 windows seven sp1 + msys2 gcc-10.3 gnat-10.3 gprbuild-2021
Linux => amd64 gcc-11.1+ gnat-11.1+ gprbuild-2021.
1o.) We need as many volunteers as possible to testing Adare_Net on as many >>> operating systems as possible and reporting his/her result to us.
currently linux and mswindows are the targets.
Very Very Very Thanks!
Enjoy!!!
Well, :-)
Why ?
The functions dont are pure ? why?
Maybe we need fix the ARM 2012+
The ARM2012 allowed it. gprbuild and gnat just follow ARM :-).
To made things as a lib be almost all pure (or yet preelaborate) there are a hard and
time consuming way to study and test. This fact is itself the main motive for almost all libs and apps ignore Ada categorizations.
Then, no one yet say if the lib work... only about pure... why? we need more than a 'freestyle' opinions.
For your use, just fork and make bether (ah and remove all Ada Categorizations :-)
====X=====
A subprogram returning content read from the network can't be pure. Or
there is something I have not understood about the Pure aspect.
Le 27/09/2021 à 06:32, Daniel Norte Moraes a écrit :Pure worked as expected in Ada83 but the meaning and utility of it disappeared with the Ada95 standard.
Em quarta-feira, 22 de setembro de 2021 Ã s 08:07:06 UTC-3, joak...
onsdag 22 september 2021 kl. 11:16:13 UTC+2 skrev AdaMagica:
I agree with you Nicolas, they should not be declared Pure. It makes the GNAT compiler check for example that there are no global variables used in the packages but other than that, they (I didn't check all the packages) are not Pure. The pragma
Yes...ish.There is no pragma Pure in Ada 83.Thanks for clearing that up AdaMagica, I wasn't aware.
Best regards,
Joakim
Really? They _are_ Pure.In a Pure package, shouldn't the subprograms also be Pure ?
I used linters extensively to result in this. one of these linters made hard use o gnat and gprbuild as his backend.
Remember this is target Ada 2012 (update 2016) and beyond => there is
no guarantee of operation for Ada versions earlier than Ada2012.
My intent is to try Adare_Net. So I started by taking a look at theThe simple explanation of Pure is that it means there is no internal-state in the package; as a consequence, (1) a value-returning call with the same parameters can be treated as idempotent and therefore can be replicated across calls; and (2) in the
sources and the first thing I noticed was the Pure aspect of the
packages. As I'm far from a Ada expert, and I like to understand things,
I asked here about it.
Is there a documentation somewhere ?
The categorizations *are* useful, as shown above... though overloading them with other properties, or rather having so coarse a granularity limits that.For your use, just fork and make bether (ah and remove all Ada Categorizations :-)
On Thursday, September 30, 2021 at 6:24:34 AM UTC-6, DrPi wrote:Pure worked as expected in Ada83 but the meaning and utility of it disappeared with the Ada95 standard.
Le 27/09/2021 à 06:32, Daniel Norte Moraes a écrit :
Em quarta-feira, 22 de setembro de 2021 Ã s 08:07:06 UTC-3, joak...
onsdag 22 september 2021 kl. 11:16:13 UTC+2 skrev AdaMagica:
I agree with you Nicolas, they should not be declared Pure. It makes the GNAT compiler check for example that there are no global variables used in the packages but other than that, they (I didn't check all the packages) are not Pure. The pragma
, which is obviously state, but externally any F(X) will return the same value given the same inputs. / Perhaps we should allow aspect PURE on subprograms, as well as introduce an aspect STATIC [having (user-defined) static-functions would, in particular,There is no pragma Pure in Ada 83.Thanks for clearing that up AdaMagica, I wasn't aware.
Best regards,
Joakim
Yes...ish.Really? They _are_ Pure.In a Pure package, shouldn't the subprograms also be Pure ?
I used linters extensively to result in this. one of these linters made hard use o gnat and gprbuild as his backend.
Remember this is target Ada 2012 (update 2016) and beyond => there is
no guarantee of operation for Ada versions earlier than Ada2012.
As mentioned upthread, you can lie about there being no internal state... and this can still be "interfacially" pure; consider a FIBONACCI function which is memoized (Function F(N: Positive) return Positive) -- internally it has the memo to look up F(N)
"AdaMagica" <christ-u...@t-online.de> wrote in message news:b1650e4c-90c6-4c75...@googlegroups.com...
I agree with you Nicolas, they should not be declared Pure. It makes the >> GNAT compiler
check for example that there are no global variables used in the packages >> but other than
that, they (I didn't check all the packages) are not Pure. The pragma
Pure worked as
expected in Ada83 but the meaning and utility of it disappeared with the >> Ada95 standard.
There is no pragma Pure in Ada 83.Pragma Pure was an IMHO failed attempt to control/document access to globals. It has much too broad of a granularity to be very useful (I've never found anything that I could make Pure outside of language-defined things, and some of those cannot be implemented as Pure even though declared that way). Ada 2022 has aspect Global to do this properly, Global => null has many fewer holes than Pure.
Note however that one can always lie about any Ada semantics in interfacing code. But any such lies make your code erroneous, and while it might work on one compiler today, there's no guarentee that it will work anywhere else (including the next update of your usual compiler). See B.1(38.1/5):
It is the programmer's responsibility to ensure that the use of
interfacing aspects does
not violate Ada semantics; otherwise, program execution is erroneous. For example,
passing an object with mode in to imported code that modifies it causes erroneous
execution. Similarly, calling an imported subprogram that is not pure from
a pure
package causes erroneous execution.
[The latter two sentences were added because programmers didn't seem to get what the first sentence means. We wanted that to be interpreted in the broadest possible way.]
Randy.
On Tuesday, October 12, 2021 at 5:49:58 PM UTC+2, Shark8 wrote:pragma Pure worked as expected in Ada83 but the meaning and utility of it disappeared with the Ada95 standard.
On Thursday, September 30, 2021 at 6:24:34 AM UTC-6, DrPi wrote:
Le 27/09/2021 à 06:32, Daniel Norte Moraes a écrit :
Em quarta-feira, 22 de setembro de 2021 Ã s 08:07:06 UTC-3, joak...
onsdag 22 september 2021 kl. 11:16:13 UTC+2 skrev AdaMagica:
I agree with you Nicolas, they should not be declared Pure. It makes the GNAT compiler check for example that there are no global variables used in the packages but other than that, they (I didn't check all the packages) are not Pure. The
N), which is obviously state, but externally any F(X) will return the same value given the same inputs. / Perhaps we should allow aspect PURE on subprograms, as well as introduce an aspect STATIC [having (user-defined) static-functions would, inThere is no pragma Pure in Ada 83.Thanks for clearing that up AdaMagica, I wasn't aware.
Best regards,
Joakim
Yes...ish.Really? They _are_ Pure.In a Pure package, shouldn't the subprograms also be Pure ?
I used linters extensively to result in this. one of these linters made hard use o gnat and gprbuild as his backend.
Remember this is target Ada 2012 (update 2016) and beyond => there is no guarantee of operation for Ada versions earlier than Ada2012.
As mentioned upthread, you can lie about there being no internal state... and this can still be "interfacially" pure; consider a FIBONACCI function which is memoized (Function F(N: Positive) return Positive) -- internally it has the memo to look up F(
Well, aspect Static for expression functions is coming... http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0075-1.txt?rev=1.15 http://ada-auth.org/standards/2xrm/html/RM-4-9.html http://ada-auth.org/standards/2xrm/html/RM-6-8.html
--
~egilhh
Le 30/09/2021 à 22:10, Daniel Norte Moraes a écrit :Pure worked as expected in Ada83 but the meaning and utility of it disappeared with the Ada95 standard.
Em quinta-feira, 30 de setembro de 2021 Ã s 09:24:34 UTC-3, DrPi escreveu:
Le 27/09/2021 à 06:32, Daniel Norte Moraes a écrit :
Em quarta-feira, 22 de setembro de 2021 Ã s 08:07:06 UTC-3, joak...@kth.se escreveu:
onsdag 22 september 2021 kl. 11:16:13 UTC+2 skrev AdaMagica:
I agree with you Nicolas, they should not be declared Pure. It makes the GNAT compiler check for example that there are no global variables used in the packages but other than that, they (I didn't check all the packages) are not Pure. The pragma
In a Pure package, shouldn't the subprograms also be Pure ?There is no pragma Pure in Ada 83.Thanks for clearing that up AdaMagica, I wasn't aware.
Best regards,
Joakim
Really? They _are_ Pure.
I used linters extensively to result in this. one of these linters made hard use o gnat and gprbuild as his backend.
Remember this is target Ada 2012 (update 2016) and beyond => there is >>> no guarantee of operation for Ada versions earlier than Ada2012.
for now Adare_Net support:
MSwindows and Linux.
was tested in:
Mswindows => starting amd64 windows seven sp1 + msys2 gcc-10.3 gnat-10.3 gprbuild-2021
Linux => amd64 gcc-11.1+ gnat-11.1+ gprbuild-2021.
1o.) We need as many volunteers as possible to testing Adare_Net on as many
operating systems as possible and reporting his/her result to us.
currently linux and mswindows are the targets.
Very Very Very Thanks!
Enjoy!!!
Well, :-)
Why ?
The functions dont are pure ? why?
A subprogram returning content read from the network can't be pure. Or
there is something I have not understood about the Pure aspect.
Maybe we need fix the ARM 2012+
The ARM2012 allowed it. gprbuild and gnat just follow ARM :-).
To made things as a lib be almost all pure (or yet preelaborate) there are a hard and
time consuming way to study and test. This fact is itself the main motive for almost all libs and apps ignore Ada categorizations.
Then, no one yet say if the lib work... only about pure... why? we need more than a 'freestyle' opinions.
My intent is to try Adare_Net. So I started by taking a look at the
sources and the first thing I noticed was the Pure aspect of the
packages. As I'm far from a Ada expert, and I like to understand things,
I asked here about it.
Is there a documentation somewhere ?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 399 |
Nodes: | 16 (2 / 14) |
Uptime: | 65:12:13 |
Calls: | 8,355 |
Calls today: | 15 |
Files: | 13,159 |
Messages: | 5,893,953 |
Posted today: | 1 |