I'm a newbie in Haskell. 
I tryed to compare performance of GHC compiled code and Ocaml compiled code
on a small example:

test n cosx
        | n==0 = cosx
        | otherwise = test (n-1) (cosx+cos(cosx))

main = print ( test  10000000 0.0 )  

I compiled it on Win NT :

ghc -o test_haskell.exe test_haskell.hs
     
When I run the program I got the following message:

Stack space overflow: current size 1048576 bytes.
Use `+RTS -Ksize' to increase it.

Hugs 98 (December 2001) version just fails with "Application Error" message.

Does a stack usage depends on number of recursive calls? Is there a tail
recursion optimization?

In Ocaml version of this program everything goes well.
The program produced the result without any complains.

Oleg Galbert



_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to