«« Next » « Previous
«« Next » « Previous

Link Details

Vote early, vote often! When you help pick the links, you'll like DZone better. Login and vote now.
Link 55028 thumbnail

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.
  • 9
  • 3
  • 1363
  • 457

Comments

Add your comment
User 245906 avatar

docmach replied ago:

0 votes Vote down Vote up Reply

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.

User 206943 avatar

mvonballmo replied ago:

0 votes Vote down Vote up Reply

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.

User 215798 avatar

anamanaman replied ago:

0 votes Vote down Vote up Reply

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.

User 251813 avatar

Ryan Ginstrom replied ago:

0 votes Vote down Vote up Reply

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.).

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (9)



Voters Against This Link (3)