From: vsnyder@gyre.jpl.nasa.gov (Van Snyder)
Subject: Re: Objects in Fortran 2000
Date: 1997/03/20
Date: 1997-03-20T00:00:00+00:00 [thread overview]
Message-ID: <5gs6ub$kb3@netline-fddi.jpl.nasa.gov> (raw)
In-Reply-To: dewar.857827520@merv
In article <dewar.857827520@merv>, dewar@merv.cs.nyu.edu (Robert Dewar) writes:
|> 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.>>
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
next prev parent reply other threads:[~1997-03-20 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
1997-03-20 0:00 ` Van Snyder [this message]
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