[Haskell-cafe] Haskell maximum stack depth

Adrian Hey ahey at iee.org
Tue Jan 29 03:18:01 EST 2008

Derek Elkins wrote:
> While perhaps for a simple throw-away program it may be beneficial to
> write code that allocates unnecessary stack, I personally consider
> unnecessary stack use a bug.  A stack overflow, to me, is always
> indicative of a bug.

The "bug" is in ghc stack management. Why is it so important that the
stack size is arbitrarily limited? It's just an intermediate data
structure, no different from any other intermediate data structure
you may build on the heap (well apart from it's efficiency). But I guess
we would be in danger of having our programs run too fast if folk were
silly enough to make use of the stack.

So perhaps the current ghc defaults are too generous. What limit do you
think should be placed on the stack size that a non buggy program can

Adrian Hey

More information about the Haskell-Cafe mailing list