[Haskell-cafe] Haskell maximum stack depth

istarex istarex at gmail.com
Mon Jan 28 14:39:36 EST 2008


On Jan 28, 2008 1:07 PM, Neil Mitchell <ndmitchell at gmail.com> wrote:

> To answer the question if Haskell has a "stack depth restriction ...
> like Java" the answer is no. It has a stack depth restriction, but its
> absolutely nothing like Java in the way it uses the stack, so you
> can't compare them.
Fair enough.

> My guess is that Istarex's inner thought might have been along the
> lines of "in Java if I do too much recursion I get a stack overflow,
> but Haskell only has recursion, does that mean I get into stack
> overflows all the time?". I could of course be entirely wrong ;-)
Well, it wasn't quite that simplistic :-).  I was considering a
specifically non-tail recursive solution to a problem, and I was
wondering if Haskell has an artificial recursion depth limit.  I
didn't stop to consider laziness, and I now realize there's a whole
dimension of this question that I didn't consider.  Thanks for the
input guys.


More information about the Haskell-Cafe mailing list