Haskell –my observations

Just trying out haskell. For all the coolness and power of infinite lists, actual performance looks absymal. Just implemented the fibonacci series as a recursively defined infinite list. And running it with naive basic options takes a visibly long time. Clearly under-utilizing the CPU resources i have. But i guess, it’s not very surprising and i ought to try it with options for memoization and other stuff.
Am beginning to doubt in my obsession with haskell’s pattern-matching i have run into a bad case of tail-call recursion.
Update: I was wrong. it turns out tail-call recursion is actually good for performance. My prog was horrible because it repeated every fibonacci call twice…. Thanks to stackoverflow for pointing out my ignorance.http://stackoverflow.com/questions/7854040/haskell-inefficient-fibonacci-implementation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.