[Haskell-cafe] OCaml list sees abysmal Language Shootout results
t.zielonka at students.mimuw.edu.pl
Thu Sep 30 13:39:04 EDT 2004
On Thu, Sep 30, 2004 at 05:40:58PM +0100, Graham Klyne wrote:
> 2. Your fileIterator certainly looks nicer (to me) than your other
> solution, but...
It looks nicer to me too.
> Tagging along with this debate, I found myself wondering if, in order to
> get performance comparable to other languages, it is really necessary to
> write code like code in other languages.
Maybe it's not necessary to get the comparable performance, but it often
is if you want to get the best performance possible. Of course I
wouldn't mind if GHC optimised high level code so well, that we wouldn't
have to do it, but I guess it's just not that easy.
What I like about GHC is that I can start from simple, high-level,
sometimes slow solutions, but if there are efficiency problems, there is
a big chance that I can solve them without switching the language.
> But I did wonder if it wouldn't be possible to also abstract out the I/O
> element of your 'fileIterate', using instead something like:
> streamIterate :: [b] -> (a -> b -> a) -> a -> IO a
It seems to be a variant of foldl. You can eliminate IO from return
type, or is there some reason for it?
.signature: Too many levels of symbolic links
More information about the Haskell-Cafe