[Haskell-cafe] newbie optimization question

Prabhakar Ragde plragde at uwaterloo.ca
Sun Oct 28 11:26:46 EDT 2007


Jerzy Karczmarczuk wrote:

> Just a trivial comment... 
> 
> 1. Don't speak about comparing *languages* when you compare *algorithms*,
>   and in particular data structures.
> 2. Please, DO code the above in C, using linked lists. Compare then. 
> 
> 3. Check the influence of bare printing, separated from the computation.

Isn't GHC clever enough to optimize away the entire computation if there 
is no I/O?

I take your points, though I am trying to do something admittedly vague, 
which is to compare fairly naive yet reasonably idiomatic programs that 
might be written by a beginning undergraduate. This particular task is 
already biased towards C, so it is reassuring that code that could be 
written less than fifty pages into Hutton is competitive with code that 
could be written -- hmmm, sixty pages into K&R, and a hundred pages into 
the C text I plan to use. --PR


More information about the Haskell-Cafe mailing list