[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
tail recursion
Date: Mon, 23 Apr 90 15:10:24 PDT
From: Warren Harris <harris@hplwhh.hpl.hp.com>
There's a lot of talk about how tail-recursion affects resource utilization.
What about how it affects the programming environment? Certainly whether an
implementation performs tail-recursion elimination or not is visible in the
debugging process (e.g. in a backtrace). It's presence may make debugging more
difficult because intermediate stack frames may be eliminated. I think this
aspect is just as important as whether the machine runs out of stack space or
not. They're both properties of the implementation.
Warren
Seeing tail-recursive items on the stack is like seeing goto's
on the stack.
Sometimes a goto-trace can be pretty useful.
Time was when certain beloved computers kept a branch trace in
hardware (a ring buffer of the last PC or the last 16 or so PC's
from which you branched).
Seeing tail-recursive items on the stack is like seeing apply's
on the stack.