• ANN: Adare_net Ada network lib

    From Daniel Norte Moraes@21:1/5 to All on Sat Sep 4 20:54:53 2021
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DrPi@21:1/5 to All on Fri Sep 17 23:04:58 2021
    Hi,

    Le 05/09/2021 à 05:54, Daniel Norte Moraes a écrit :
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Joakim Strandberg@21:1/5 to All on Wed Sep 22 01:47:13 2021
    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 Pure
    worked as expected in Ada83 but the meaning and utility of it disappeared with the Ada95 standard. It is possible in Ada95 to declare a package as Pure and then import C-functions that can do anything. It is also possible in Ada95 to circumvent the
    meaning of pragma Pure or the Pure aspect by taking advantage of dynamic dispatch. If there is any use of a tagged type inside a package or there is some C-function that is imported, the package should not be labeled as Pure. It should be possible to
    develop a libadalang- or ASIS based application to check for this. Well, this is a small issue since it is easy to remove the Pure aspects. In any case, thanks to the author for writing adare_net and sharing it with the World!

    Best regards,
    Joakim

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From AdaMagica@21:1/5 to All on Wed Sep 22 02:16:12 2021
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Joakim Strandberg@21:1/5 to All on Wed Sep 22 04:07:05 2021
    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 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.

    Thanks for clearing that up AdaMagica, I wasn't aware.

    Best regards,
    Joakim

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Daniel Norte Moraes@21:1/5 to All on Sun Sep 26 21:32:25 2021
    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
    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.
    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!!!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Randy Brukardt@21:1/5 to All on Mon Sep 27 23:52:33 2021
    "AdaMagica" <christ-usch.grein@t-online.de> wrote in message news:b1650e4c-90c6-4c75-8ee0-d7760f573320n@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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DrPi@21:1/5 to All on Thu Sep 30 14:24:30 2021
    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
    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.
    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.

    In a Pure package, shouldn't the subprograms also be Pure ?


    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!!!





    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Daniel Norte Moraes@21:1/5 to All on Thu Sep 30 13:10:50 2021
    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
    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.
    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.
    In a Pure package, shouldn't the subprograms also be Pure ?

    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=====

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DrPi@21:1/5 to All on Fri Oct 1 19:33:41 2021
    Le 30/09/2021 à 22:10, Daniel Norte Moraes a écrit :
    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
    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.
    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.
    In a Pure package, shouldn't the subprograms also be Pure ?

    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 ?

    For your use, just fork and make bether (ah and remove all Ada Categorizations :-)

    ====X=====


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Wright@21:1/5 to DrPi on Fri Oct 1 20:11:27 2021
    DrPi <314@drpi.fr> writes:

    A subprogram returning content read from the network can't be pure. Or
    there is something I have not understood about the Pure aspect.

    ARM 10.1.1(18)[1] says

    "[...] the implementation may omit a call on such a subprogram and
    simply reuse the results produced by an earlier call on the same
    subprogram, provided that [...]. This permission applies even if the
    subprogram produces other side effects when called."

    [1] http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-10-2-1.html#p18

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Shark8@21:1/5 to DrPi on Tue Oct 12 08:49:56 2021
    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 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.
    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.
    In a Pure package, shouldn't the subprograms also be Pure ?
    Yes...ish.
    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),
    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,
    allow some nice "macro-lite" functionality].

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Shark8@21:1/5 to DrPi on Tue Oct 12 09:00:44 2021
    On Friday, October 1, 2021 at 11:33:45 AM UTC-6, DrPi wrote:

    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 ?
    The 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
    Distributed Systems Annex, we can replicate this package across partitions w/o worrying about synchronization precisely because there is no internal state.

    So, "ideologically" having a networking library marked "pure" is not _necessarily_ a wrong thing -- though treating such calls as idempotent certainly would be -- and perhaps that is a point where some refinement could be made; perhaps allowing
    subprograms to be marked aspect VOLATILE to indicate that they are not idempotent or some such.

    For your use, just fork and make bether (ah and remove all Ada Categorizations :-)
    The categorizations *are* useful, as shown above... though overloading them with other properties, or rather having so coarse a granularity limits that.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Egil H H@21:1/5 to All on Tue Oct 12 12:44:32 2021
    On Tuesday, October 12, 2021 at 5:49:58 PM UTC+2, Shark8 wrote:
    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 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.
    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.
    In a Pure package, shouldn't the subprograms also be Pure ?
    Yes...ish.
    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)
    , 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,
    allow some nice "macro-lite" functionality].

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Daniel Norte Moraes@21:1/5 to All on Thu Dec 30 12:56:04 2021
    Em terça-feira, 28 de setembro de 2021 às 01:52:37 UTC-3, Randy Brukardt escreveu:
    "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.

    We apologize for the delay in responding. I (daniel) was expecting the 'static aspect' to have
    more support (I gotted this suggestion, and thanks to you who suggested it). With the development release of gnat-12 I'll try to answer all the questions and make all the suggested
    changes that make sense.

    Really Randy, I'm aware about this.
    I´ll try answer in order:

    1) var'address as mode in: the address in the import functions and procedures don't are changed. when there are a change, the change is just
    in the data that address point to. this is a standard pratice in ada bind world. we dont use 'in out' mode because the address don't are changed.

    2) object'address and for object'address use 'var': a) remember by the src code, the true 'lengths' are saved and used without
    violate the address space (really this is my responsability as programmmer) b) and
    (besides some bug by off-one not yet hunted). c) this is sure enforced. d) I get a instantaneos segfault if this
    dont are enforced. e) this 'enforcement' is transparent to user. f) the user dont have access to this 'internals' , It is isolated from his/her.

    3) besides an aparent violation, a) this was necessary to get values, in reality a 'view change' to get the real values. compilers obligied me
    to do this, afters some months, figthing against some linux patchs (permantent patchs) and segfault in mswindows. Besides the harmless and legitimate use
    without 'view change', gcc gnat linux and mswindows dont permited this.

    4) import var convention c: a) the mostly vars is embedded from _c vars in adare-net c sources_. the Ada RM made a excption in this case when this is
    imported vars.

    etc.

    From now:

    I can transform mostly imported vars in static functions.

    Pleeease All, Say us What you want and or What you complains(with filename and line_number) and yours sugestions.

    Ah! The Version of Ada is 202x.

    Enjoy with us!

    Best Whishes, Dani.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Daniel Norte Moraes@21:1/5 to All on Thu Dec 30 13:30:54 2021
    Em terça-feira, 12 de outubro de 2021 às 16:44:33 UTC-3, ehh.p...@gmail.com escreveu:
    On Tuesday, October 12, 2021 at 5:49:58 PM UTC+2, Shark8 wrote:
    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
    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.
    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.
    In a Pure package, shouldn't the subprograms also be Pure ?
    Yes...ish.
    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), 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, allow some nice "macro-lite" functionality].
    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

    Thanks! I Followed Your Suggestion!
    Now that there is good support for ada202x in gcc-12, we have started solving the reported issues and adding everyone's suggestions.

    https://gitlab.com/daresoft/network/adare_net/-/tree/202x

    Beer with us!

    Best Wishes and Happy New Year(!),
    Dani.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Daniel Norte Moraes@21:1/5 to All on Thu Dec 30 13:15:34 2021
    Em sexta-feira, 1 de outubro de 2021 às 14:33:45 UTC-3, DrPi escreveu:
    Le 30/09/2021 à 22:10, Daniel Norte Moraes a écrit :
    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
    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.
    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.
    In a Pure package, shouldn't the subprograms also be Pure ?

    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 ?

    We will create a pdf with the api, after upgrading to ada202x and adding support for more operating systems, this includes solving reported
    issues and adding suggestions from all of you, 'pure' and 'global' and 'nonblocking => false' and etc included.

    While this, You can use the programs in 'exemple folder'. it contains working client and server src and programs. mostly time Its are in 'pairs' of filenames.
    Thanks,
    Best Whishes,
    Dani.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)