Re: OON: Comparison between Fortran & C++

From: Arch Robison (robison@kai.com)
Date: Fri Mar 24 2000 - 09:56:22 EST


My observation about the no-aliasing rule in FORTRAN:

        1. Academics who write optimizers love it.
        2. Most practicing FORTRAN programmers are clueless about it.

For proof of (2), I worked with a lot of FORTRAN programmers in industry
at one time. I never met one who had heard of the prohibition about aliasing,
and indeed ran across FORTRAN routines with comments that said that it
was okay to pass the same actual argument in to two formal arguments to
get a certain effect. E.g., using an array copying routine to replicate
a scalar throughout, via something like ``call copy(a(1), a(2), 1000)''
where copy was:

        subroutine copy(x,y,n)
        real x(*), y(*)
        do 100 i=1,n
            x(i) = y(i)
    100 continue

I have some doubts as to whether any tru large-scale programs in FORTRAN
actually obey the no-alias rule.

Certainly, removing aliasing from a language that supports abstract data types
is impossible, because by definition an abstract data type is a black box inside.
Knowing whether two black box's internal guts cause aliasing requires knowing
their guts.

Arch D. Robison Kuck & Associates Inc.
robison@kai.com 1906 Fox Drive
217-356-2288 ext. 56 Champaign IL 61820
Lead Developer for KAI C++ http://www.kai.com/C_plus_plus/index.html

--------------------- Object Oriented Numerics List --------------------------
* To subscribe/unsubscribe: use the handy web form at
http://oonumerics.org/oon/
* If this doesn't work, please send a note to owner-oon-list@oonumerics.org



This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 03:20:10 EST