You pick the winners! Login and vote now.
By bloid
via cgi.cse.unsw.edu.au
Published: Nov 29 2007 / 00:40
Antonio Cangiano writes about how Ruby 1.9 supports proper tail calls, making recursion moderately practical, with the result that computing the naive fibonacci algorithm is finally faster is Ruby than in Python, where recursion isn't optimised to a tail call. So I wondered how well Haskell would do at something like this, and whether we could squeeze any more performance out using some cheap parallelism.
Comments
docmach replied ago:
Haskell is an amazing language. It seems to get overlooked because it is perceived as hard, but it really is very easy and very powerful.
mvonballmo replied ago:
To answer the author's final question of "Which high level language would you choose?". Though coding the Fibonacci looks like fun, it's not a goal of my projects. So I have to choose the best language possible, but that still offers support for writing GUIs and web applications, communicating with databases, which are goals of most of my projects.
anamanaman replied ago:
I agree. If people want to promote Haskell, they need to build a web framework that rivals Rails / Django / Seaside. Otherwise they are just blowing smoke.
It could be the fastest language the world has ever seen, but if I can't write anything useful then its no more than a toy.
Ryan Ginstrom replied ago:
Although I voted this up, I believe that the ruby article clarified in the comments that the speedup had nothing to do with tail recursion optimization.
Basically, if you're doing recursion you're in Haskell's world. That's why iteration is preferred in Ruby/Python(/C++/etc.).
Voters For This Link (9)
Voters Against This Link (3)