Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!lamaster From: lamaster@ames.arc.nasa.gov (Hugh LaMaster) Newsgroups: comp.lang.fortran Subject: Re: Fortran versus C for numerical anal Message-ID: <15265@ames.arc.nasa.gov> Date: 21 Sep 88 16:06:07 GMT References: <50500075@uxe.cso.uiuc.edu> <3708@lanl.gov> <1530@ficc.uu.net> <15145@ames.arc.nasa.gov> <1552@ficc.uu.net> Reply-To: lamaster@ames.arc.nasa.gov.UUCP (Hugh LaMaster) Organization: NASA Ames Research Center, Moffett Field, Calif. Lines: 37 In article <1552@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes: >In article <15145@ames.arc.nasa.gov>, lamaster@ames.arc.nasa.gov (Hugh LaMaster) writes: >> I think the point of dynamically sized arrays has been lost here. > >Nah, it wasn't ever there. Jim's assertion was that he has never seen >of statically allocated ones. Yes, conformant arrays are very nice. No, I guess I lost the thread of the argument in all the postings! Sorry about that. While we are on the subject though, I find that lack of conformant arrays is probably the only real stumbling block to using C for numerical analysis. But, it is a MAJOR stumbling block. Fortran is the language of numerical analysis today. Since it is so similar to C, it might be nice to use a single language for most things. But right now, there is no way to write precompiled libraries which handle multi-dimensional arrays in a CONSISTENT way (some have suggested that the "standard" has now been set by "Numerical Recipes" - maybe so... ) defined in the language itself. And, in any case, using an array of pointers when you just mean a multi-dimensional array is introducing a lot of error-prone machinery for such a simple idea; most numerical analysts balk at such unnecessary complication. Another possible stumbling block is optimization. I believe that, once C gets dynamically sized arrays, and people start using it for numerical analysis, vendors will start putting "go ahead and ignore possible aliasing problems" switches on compilers, thus opening up another whole can of worms. On fast vector machines, the payoff CAN be a factor 30 for a code that vectorizes well. -- Hugh LaMaster, m/s 233-9, UUCP ames!lamaster NASA Ames Research Center ARPA lamaster@ames.arc.nasa.gov Moffett Field, CA 94035 Phone: (415)694-6117