Alastair Reid wrote:
> 
> > What would be even more useful would be a tool that told you
> > where/why the stack was use by the above declaration.
> 
> o configure with --enable-stack-dumps
> o increase NUM_STACK in prelude.h so that you get a Control stack
>   overflow (caught by Hugs) instead of a C stack overflow (segmentation fault)
> o increase the value of UPPER_DISP in storage.c
> o recompile
> o don't install the result as your standard Hugs
>   (it is much slower)
> 
> Run the program again using the new copy of Hugs
> 
> You'll get a dump of part of the stack which should give you some
> pointers to where/why the overflow occured.  Could be more useful but
> it's better than nothing.

I was more meaning that its a simple piece of code, so why can't a
program run some analysis, and tell us that the stack usage will in
proportion to the size of the integer input. A bit like big-O, but
for stack usage.

I know its a difficult topic, but we can't even understand how
our *simple* programs are using the resources we are giving it
(stack and heap)

Perhaps on of the various Haskell debugging projects will have
a viewer that allows you to watch the stack usage?

Andy Gill

Reply via email to