Vectorizing C compiler for the Cray

Ken Montgomery kjm at ut-ngp.UUCP
Thu Apr 4 05:15:57 AEST 1985


[]

From: brooks at lll-crg.ARPA (Eugene D. Brooks III)
>After a lot of procrastination we are finally going to get a Vectorizing
>C compiler for the Cray computers for those interested in doing numerical
>work in the C language.  Just think, a C program running at 160 megaflops.
>This will be great!

Sounds like fun!  (Not to mention useful!)

>A committee at LLNL has studied the language and its suitability for numerical
>work and is implementing the full C language with one minor modification.
>In order to have compatibility with Fortran all subroutine parameters will
>be passed by address.  A small price to pay for good floating point performance
>don't you think?

No.  What you have after that modification is no longer C.  To wit, K&R
has a *whole section* (#1.8, on page 24) titled "Arguments - Call by
Value".  Call-by-value is justified as follows:

    ... because arguments can be treated as conveniently initialized
    local variables in the called routine.

I submit that many, many programs take advantage of this feature, so
the change to call-by-reference would break a large amount of existing
software.  In addition, call-by-reference is unsafe, since one has no
idea what a routine loaded from someone else's object library does to
its arguments.  (Yes, I know one can program around this, but the
work-around is a crock.)  As already mentioned, call-by-reference can
be simulated where necessary with pointers (or you could define the
'fortran' keyword as a way to force call-by-reference to individual
functions).

--
The above viewpoints are mine.  They are unrelated to
those of anyone else, including my cats and my employer.

Ken Montgomery  "Shredder-of-hapless-smurfs"
...!{ihnp4,allegra,seismo!ut-sally}!ut-ngp!kjm  [Usenet, when working]
kjm at ut-ngp.ARPA  [for Arpanauts only]



More information about the Comp.lang.c mailing list