[Haskell-cafe] Can Haskell outperform C++?

Yves Parès yves.pares at gmail.com
Mon May 21 16:51:05 CEST 2012


> I do think we have the opposite problem, however, in much Haskell code --
people are using the clean, obviously correct, but inefficient code even in
standard library functions that really should be optimized like crazy!

And even before optimizing "like crazy", I think the functions that are
"more often" good should be emphasized: Prelude should export foldl'
together with/instead of foldl, sum should have its sum' counterpart (or
even be rewritten to use foldl'), and so on...
It baffles me that functions that are said to be more efficient in the
majority of cases are not the default.

> I have worked at places in industry where teams automatically use C++ for
everything.

Have they looked at you like if you were an alien (and even said you were
not a serious developper) when you emitted the possibility of evaluating
the feasibility of using/making a more expressive language for a specific
task?

2012/5/21 Ryan Newton <rrnewton at gmail.com>

> The unconditional desire for maximum possible object code
>> performance is usually very stupid, not to mention impossible to reach
>> with any high level language and any multi-tasking operating system.
>>
>
> Definitely.  I don't know if we have a catchy term for "kneejerk
> optimization" or if it falls under the broader umbrella of "premature
> optimization" [including misdirected or unneeded optimization].
>
> I do think we have the opposite problem, however, in much Haskell code --
> people are using the clean, obviously correct, but inefficient code even in
> standard library functions that really should be optimized like crazy!
>
>
>>  Haskell's average penalty compared to C is
>> no reason to write the entire application in C.
>
>
> Yes, this seems to be a separate disease.  Not just using low-level langs,
> per se, but using them for *everything*.  I have worked at places in
> industry where teams automatically use C++ for everything.  For example,
> they use it for building all complete GUI applications, which surprises me
> a little bit.  I would have thought in recent years that almost everyone
> was using *something* else (Java,Python, whatever) to do much of the
> performance-non-critical portions of their application logic.
>
>   -Ryan
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120521/0cace24a/attachment.htm>


More information about the Haskell-Cafe mailing list