
From: Daniel Carrera
To: Haskell-Cafe@haskell.org Subject: Re: [Haskell-cafe] Haskell vs OCaml Date: Sat, 24 Dec 2005 20:07:00 +0000 Tomasz Zielonka wrote:
When it comes to Haskell, speed is mostly an implementation issue.
I just took another look at this. By "implementation issue" do you mean the person who implements the compiler or the program being compiled? If the latter... other emails here suggest that writing an efficient Haskell program is a difficult task :-(
I've found that Haskell is pretty good in implementing recursive algorithms. Problem cames when one want's to implement non recursive algorithm by terms of recursion as Haskell does not support loops. Perhaps if we can get loops, situation will improve, but then that wouldn't be functional style. Try for example to implement recursive calculation of matrix determinant in some classic imperative language and in Haskell on large matrix, or compare performance of recursive descent parser implemented in Haskell and language which does not handles recursion so well as Haskell. Other problem is that Haskell data is lazy and optimised for size rather then speed. One have to use non lazy structures in order to compete with imperative languages speed combined with non recursive algo's. Difficulty came when one has to utilize Haskell advantages and reduce much as possible disadvantages. After all you can peek and poke over Ptr's same as in C which will give you speed as in C :) (I've tried that works well as I used to peek/poke:) Greetings, Bane. _________________________________________________________________ FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/