Re: [Haskell-cafe] Stack, Heap and GHC

2006-12-16 Thread Bulat Ziganshin
Hello Felix, Thursday, December 14, 2006, 6:00:53 PM, you wrote: The program isn't that well written so the overflow did not surprise me, I expected that it might run out of memory. What did surprise me was the *stack* overflow. I do not use recursion in my program except for a couple of

Re: [Haskell-cafe] Stack, Heap and GHC

2006-12-16 Thread Ian Lynagh
On Fri, Dec 15, 2006 at 10:05:38AM +, Felix Breuer wrote: On Thu, 14 Dec 2006 15:31:54 -0800, David Roundy [EMAIL PROTECTED] wrote: main = do putStrLn strict foldl1 print $ foldl1' (\a b - a + 1) $ [1..largenum] putStrLn lazy foldl1 print $ foldl1 (\a

Re: [Haskell-cafe] Stack, Heap and GHC

2006-12-15 Thread David House
On 15/12/06, Felix Breuer [EMAIL PROTECTED] wrote: 1) What precisely is a thunk? It's a memory cell that says 'I'm an unevaluated value, to evaluate me do X'. For example, consider the differences between the following programs: (common for all that follows) myFunc :: [Int] - [Int] (1)

Re: [Haskell-cafe] Stack, Heap and GHC

2006-12-14 Thread Brandon S. Allbery KF8NH
On Dec 14, 2006, at 10:00 , Felix Breuer wrote: 3) I tried using +RTS -Ksize as suggested, but these options do not seem to be passed through if I use --make. How can I use both, these compilation flags and --make? They aren't compile options; they're runtime options. The GHC runtime

Re: [Haskell-cafe] Stack, Heap and GHC

2006-12-14 Thread David Roundy
On Thu, Dec 14, 2006 at 04:00:53PM +0100, Felix Breuer wrote: Hello everyone, I have been trying to run a Haskell program of mine that does an extensive computation with very large amounts of data. I compiled the program with ghc --make. When I run it it terminates after some time with the

Re: [Haskell-cafe] Stack, Heap and GHC

2006-12-14 Thread David Roundy
On Thu, Dec 14, 2006 at 04:00:53PM +0100, Felix Breuer wrote: Hello everyone, I have been trying to run a Haskell program of mine that does an extensive computation with very large amounts of data. I compiled the program with ghc --make. When I run it it terminates after some time with the

Re: [Haskell-cafe] Stack, Heap and GHC

2006-12-14 Thread Donald Bruce Stewart
felix: Hello everyone, I have been trying to run a Haskell program of mine that does an extensive computation with very large amounts of data. I compiled the program with ghc --make. When I run it it terminates after some time Did you compile with -O (optimisations). Sometimes this fixes

Re: [Haskell-cafe] Stack, Heap and GHC

2006-12-14 Thread Neil Mitchell
Hi Did you compile with -O (optimisations). Sometimes this fixes things, and its just good practice. It's slower to compile, and might fix things in GHC Haskell, but other compilers don't all have -O flags, so its generally best to make your program at least have the right sort of time/space