EmbeddedRelated.com
Forums

Processors who's stack grows up

Started by Adam Messer January 4, 2005
In comp.arch.embedded Everett M. Greene <mojaveg@mojaveg.iwvisp.com> wrote:

> Fortran not supporting recursion is an industry myth probably a > side-effect of early implementation techniques. There is nothing in > the ANSI Fortran standard which precludes a stack-oriented > implementation thus allowing recursion.
You're missing the point, I think. The fact that the Fortran standard doesn't preclude a stack-based implementation allowing allow recursion, by no means implies that Fortran "supports recursion". To back up a claim that Fortran (as such, rather than a particular implementation) supported recursion, the language standard would have to *enforce* that it's possible. I'm quite sure it doesn't -- Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de) Even if all the snow were burnt, ashes would remain.
On Wed, 19 Jan 2005 09:27:34 PST, mojaveg@mojaveg.iwvisp.com (Everett
M. Greene) wrote:

>Fortran not supporting recursion is an industry myth >probably a side-effect of early implementation techniques. >There is nothing in the ANSI Fortran standard
That may be the case with Fortran 77 and later versions, but I was referring to Fortran II and Fortran IV.
>which >precludes a stack-oriented implementation thus allowing >recursion.
If you put the local variables into a stack, it would break quite a lot old Fortran programs (including some widely used library code) that assume that the local variable values are maintained between calls. Paul
Paul Keinanen <keinanen@sci.fi> writes:
>mojaveg@mojaveg.iwvisp.com (Everett M. Greene) wrote: > > >Fortran not supporting recursion is an industry myth > >probably a side-effect of early implementation techniques. > >There is nothing in the ANSI Fortran standard > > That may be the case with Fortran 77 and later versions, but I was > referring to Fortran II and Fortran IV. > > >which > >precludes a stack-oriented implementation thus allowing > >recursion. > > If you put the local variables into a stack, it would break quite a > lot old Fortran programs (including some widely used library code) > that assume that the local variable values are maintained between > calls.
I just said the standard doesn't preclude reentrancy. Since the standard doesn't define the behavior, different programs written for different implementations may rely on the behavior of a particular implementation.