From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:aed:3a24:: with SMTP id n33mr9985222qte.361.1565210579478; Wed, 07 Aug 2019 13:42:59 -0700 (PDT) X-Received: by 2002:aca:5ac6:: with SMTP id o189mr22256oib.37.1565210579063; Wed, 07 Aug 2019 13:42:59 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.dns-netz.com!news.freedyn.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!b26no9880298qtq.0!news-out.google.com!y1ni139qtn.0!nntp.google.com!b26no9880289qtq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 7 Aug 2019 13:42:58 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=47.185.223.245; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 47.185.223.245 References: <3862f4a3-d3b2-4959-b6f4-08086738df2c@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: The answer to "Can Ada replace FORTRAN for numerical computation? From: Optikos Injection-Date: Wed, 07 Aug 2019 20:42:59 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 6826 X-Received-Body-CRC: 1195669644 Xref: reader01.eternal-september.org comp.lang.ada:57006 Date: 2019-08-07T13:42:58-07:00 List-Id: On Wednesday, August 7, 2019 at 1:35:33 AM UTC-5, Niklas Holsti wrote: > On 19-08-05 20:15 , Optikos wrote: > > On Monday, August 5, 2019 at 9:35:10 AM UTC-5, Shark8 wrote: > >> On Saturday, August 3, 2019 at 6:30:36 AM UTC-6, Nasser M. Abbasi > >> wrote: > >>> There are also significant limitation to Ada as a language for > >>> scientific computation, in particular with regard to dynamic > >>> typing and storage allocation. > >> > >> I think this is referring to things like dynamically-sized arrays, > >> rather than "X is an integer there, now it's a String!" when > >> talking about dynamic-typing, as it's obvious that the latter would > >> obliviate the aforementioned properties of finding conceptual > >> errors. > > > > But there are 2 usages of considering something an integer for the > > moment in a few lines of code. One is to floor-truncate a floating- > > or fixed-point number to an integer; Ada supports syntax for this > > semantic meaning. >=20 > Yes of course. >=20 > > But another is to consider a floating-point > > representation as a machine-word to perform integer-based bit > > twiddling to conform the representation of the floating-point number > > to some machine requirements or machine representation that Ada's > > syntax and semantics lacks; pre-1995 Ada (the subject matter of the > > paper referenced) was abysmal at this commonplace use case in > > Fortran, PL/I, and C. >=20 > No, record types with representation clauses plus Unchecked_Conversion=20 > were fully able to handle this case, already in Ada 83. >=20 > >> As to the storage-allocation, I suspect it is also referring to Ada > >> arrays needing definite bounds in certain cases -- the ability to > >> return properly-sized arrays from a function *should* be enough to > >> ease this complaint *EXCEPT*, perhaps, when dealing with Very Large > >> Arrays. >=20 > They may also have been scared by the "Unchecked" in=20 > Unchecked_Deallocation. The identifier "free" is so much more friendly=20 > and safe-sounding... >=20 > > Again, Ada has had a storage-pool wisdom at the heart of its storage > > allocation strategies, but pre-1995 Ada staunchly lacked PL/I's and > > Fortran's and C's ability to ecumenically reach out and > > read/write/manipulate some other language's in-memory storage format, > > as a I-got-you-covered system-programming duty. >=20 > I doubt your statement. =E2=80=A6, and you can do any format manipulation= s you=20 > want with Ada 83 as well as with Fortran or C. Please show a=20 > counter-example if you insist on this point. https://gcc.gnu.org/onlinedocs/gcc-4.8.1/gnat_ugn_unw/Representation-Clause= s.html Before we dive into a counter-example in source code for various languages,= let's start, as linked above, with the Ada community speaking for itself r= egarding Ada83's lackluster (i.e., lack of clear mandate regarding) represe= ntation clauses. Indeed, as mentioned in recent months on c.l.a., Janus/Ad= a to this day does not fully support some semantics of representation claus= es, even after all these decades. A programming language is not what merel= y is on paper in its standard, especially when noncompliance with the conte= nt of the standard is overtly permitted by the (excessively-)permissive spe= cification of the language in the standard. (And not all the tarnish of representation clauses was polished off by Ada9= 5 either, according to the commentary linked above.) > There is nothing in Fortran or C that supports "other languages' formats" Again, a language is more than merely being a bag of features overtly state= d via extant text in its standard or specification =E2=80=A2document=E2=80= =A2. Indeed, Fortran, PL/I, and C are famous & popular (and should I say, = notorious & infamous) for the breadth of their permissiveness regarding in-= memory layout, and lack of staunch regulation of semantics in general. Hen= ce, what is elided from being stated in the standard's extant text in order= to =E2=80=A2=E2=80=A2enact the permissiveness=E2=80=A2=E2=80=A2 is far mor= e important on this inter-language use-case than any word, clause, sentence= , or paragraph that overtly appears as text in the standard or specificatio= n of the loosey-goosey languages. Furthermore, your statement is clearly factually incorrect regarding Fortra= n 2003's overtly-specified feature-set for inter-oping with C =E2=80=A2dire= ctly=E2=80=A2 without the need for a Fortran wrapper anymore, which was the= technique that was extant at the time of the 1980 paper that started this = whole thread. (These same low-level-layout system-programming techniques i= n Fortran were utilized by Prime Computer back in the day that they wrote w= hole operating systems in Fortran IV as a poor-man's system-programming lan= guage prior to switching to PL/P, which was their dialect of Multics PL/1.)= For a summary of Fortran 2003's standardized intimate binding with C nowa= days, please see slide 10 of: https://ModelingGuru.nasa.gov/servlet/JiveServlet/previewBody/1361-102-6-17= 55/Introduction_F2003.pdf And of course we could dive into the Fortran standard documents themselves = regarding their evermore-extensive inter-op with C: https://gcc.gnu.org/wiki/GFortranStandards