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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5f39173193c39af X-Google-Attributes: gid103376,public X-Google-Thread: 1094ba,a97c18c9ff9b447 X-Google-Attributes: gid1094ba,public From: vsnyder@gyre.jpl.nasa.gov (Van Snyder) Subject: Re: Objects in Fortran 2000 Date: 1997/03/20 Message-ID: <5gs6ub$kb3@netline-fddi.jpl.nasa.gov>#1/1 X-Deja-AN: 227097600 References: <01bc280b$32c42d40$dac32299@default> <5fmemp$bgo@fg70.rz.uni-karlsruhe.de> Organization: Jet Propulsion Laboratory Newsgroups: comp.lang.fortran,comp.lang.ada Date: 1997-03-20T00:00:00+00:00 List-Id: In article , dewar@merv.cs.nyu.edu (Robert Dewar) writes: |> Thomas says |> |> < (especially HPF) to the next Ada standard than to add more |> object-oriented features to Fortran. |> |> What's missing in Ada that is present in HPF or Fortran 95? I |> can think of the following, and hope that others will extend the |> list: |> |> - FORALL (similar to a DO loop in Fortran, or a for loop in |> Ada, except that the order of execution isn't specified, |> so that automatic paralellization is very easy) |> |> - PURE subroutines, which can't have any side effects (checkable by |> the compiler). Ideal for sticking into FORALL statements. |> |> - Built-in array arithmetic (quite easy to do with a library in Ada) |> |> I don't think these concepts would 'spoil' Ada, and it does have |> a cleaner overall design than Fortran.>> I agree that Ada's type system is more systematic that Fortran's (which is mostly absent). But here is something else I found attractive about Fortran 90, as compared to Ada: In Fortran, one can add the POINTER or ALLOCATABLE attribute to a declaration, add an ALLOCATE and DEALLOCATE statement, and _not_touch_ the usages. In Ada, one needs to track down all the usages and add ".all" onto them. This derives from Fortran doing automatic dereferencing, and having a separate => operator for pointer assignment. Ada chose to use the ordinary assignment operator for pointer assignment, and to interpret "p := q;" as pointer assignment, and do something different to mean "dereference p and q and copy the values." |> Robert replies .... |> As to Pure, GNAT already has this feature, added in GNAT 3.09: |> |> A new pragma Pure_Function allows an individual function to be specified |> as Pure, see documentation in the GNAT reference manual for full details. |> |> That is a quote from the features file. Be sure to read the GNAT reference |> manual, there are lots of interesting pragmas and attributes. Of course if |> you use them, your code may not be portable to non-GNAT compilers, but it |> will be portable among diferent GNAT compilers. This is exactly the point to having things like PURE as part of the language, not as optional pragmas. |> The built-in array arithmetic is not so easy to do efficiently, but is |> certainly doable. Much harder is the extensive slicing capability and |> aggregate capability of Fortran-90 (f90 is a BIG language, in some |> respects much larger than Ada). This is on my list, too, and Robert said it well. I'd say Fortran is bigger in some _areas_ than Ada, but overall, Ada is significantly bigger. BTW, Robert, the Fortran proposal for exception/handler blocks, similar to the way Ada does it, foundered on the semantics of the combination of exceptions and parallelism. Has the Ada community some insight/advice to offer concerning the semantics of exception blocks in the presence of parallelism? -- What fraction of Americans believe | Van Snyder Wrestling is real and NASA is fake? | vsnyder@math.jpl.nasa.gov