[Haskell-cafe] Why does GHC limit stack size?

Derek Elkins derek.a.elkins at gmail.com
Sat Nov 3 23:41:49 EDT 2007


On Sat, 2007-11-03 at 11:40 +0000, Adrian Hey wrote:
> Bulat Ziganshin wrote:
> > because program that require 8mb stack, will probably require 8gb when
> > processing more data :)
> 
> So.. what? You could say the same about heap, which was rather the point
> of the earlier thread.

I personally would prefer a small stack.  I do not write my programs
with the intent that they should take up linear or more stack space and
I want to know relatively quickly if they are using an excessive amount.

I don't want something to use O(n) stack when it could be using O(1).
Usually, it's relatively easy to fix "stack leaks" and indeed can lead
to better algorithms, e.g. using foldr v. foldl.




More information about the Haskell-Cafe mailing list