Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!turnkey!orchard.la.locus.com!prodnet.la.locus.com!jfr From: jfr@locus.com (Jon Rosen) Newsgroups: comp.lang.misc Subject: Re: Fortran vs. C for numerical work Message-ID: <20467@oolong.la.locus.com> Date: 11 Dec 90 14:53:22 GMT References: <13552@chaph.usc.edu> <1990Dec10.070017.19821@actrix.gen.nz> <13585@chaph.usc.edu> Organization: Locus Computing Corp, Los Angeles Lines: 23 In article <13585@chaph.usc.edu> jeenglis@alcor.usc.edu (Joe English Muffin) writes: >Bruce.Hoult@bbs.actrix.gen.nz writes: > >>>>In C or Pascal you could allocate a structure as a global (static) variable, >>> ^^^^^^^^^^^^^^ >>>To allow recursion, the compiler would have to allocate this >>>as 'auto,' in the caller's stack frame. > > > >It's very difficult for the compiler to determine >that there's no recursion going on. ... Ah... it should be noted that PL/I (an often denigrated but in many ways superior language to both FORTRAN and C) solves this problem quite neatly... Routines may be declared RECURSIVE in which case automatic variables are allocated as part of a "frame" along with the appropriate register save areas. Any routine not so declared may not be used recursively and only one copy of local variables is created. This permits increased optimization by the compiler and also reduces performance degradation due to reallocation of local variables. Jon Rosen