comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Objects in Fortran 2000
Date: 1997/03/08
Date: 1997-03-08T00:00:00+00:00	[thread overview]
Message-ID: <dewar.857827520@merv> (raw)
In-Reply-To: 5fmemp$bgo@fg70.rz.uni-karlsruhe.de


Thomas says

<<By now, it would almost make more sense to add Fortran features
(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.>>


Robert replies

With regard to FORALL, those with an old enough archive of CLA can find
a very extensive discussion of this point (or was it on the VR list)?
Actually I think it was on the VR list, I seriously argued for including
the forall (spelled for all, how else??) in Ada, but one of the strong
arguments against it was that a number of significant parallel Fortran people
argued against it, claiming that modern compilers can always, ir
or at least almost alway, extract this information, so it ends up being
unuuseful over-specification.

An easy way to put this in would be as a pragma applied to the loop label.
The pragma would say thto the compiler: the semantics of this loop does
not depend on the order of elaboration

Actually we could do it just by pragma placement:

    for x in ... loop
       prama Any_Order;
       ...

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.

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).

In GNAT 3.10, there is a GNAT.Spitbol package that provides extensive
mimicking of SNOBOL4 capablity as implemented by Spitbol. The intention
here is to introduce a series of packages GNAT.xxx for various languages.
\x1a





  parent reply	other threads:[~1997-03-08  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <01bc280b$32c42d40$dac32299@default>
1997-03-06  0:00 ` Objects in Fortran 2000 Thomas Koenig
1997-03-06  0:00   ` Robert A Duff
1997-03-06  0:00   ` Larry Kilgallen
1997-03-08  0:00   ` Robert Dewar [this message]
1997-03-20  0:00     ` Van Snyder
1997-03-21  0:00       ` Robert A Duff
1997-03-22  0:00         ` Robert Dewar
1997-03-23  0:00           ` William Clodius
replies disabled

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