[Haskell-cafe] Small question

Stefan O'Rear stefanor at cox.net
Fri Aug 10 02:52:23 EDT 2007


On Fri, Aug 10, 2007 at 02:28:09PM +0800, Hugh Perkins wrote:
> On 8/10/07, Stefan O'Rear <stefanor at cox.net> wrote:
> >
> > Haskell's purpose: To be a generally cool language
> > Haskell's competition: C++, SML, ... hundreds of thousands more and I make
> > no assertion of a representative sample ...
> >

> Wrt imperative languages, it probably makes more sense to compare Haskell
> with imperative languages that do have a GC and for which it's near
> impossible to accidentally corrupt the stack/heap.  You'll find by the way
> that the imperative GC'd, stack/heap protected languages run *significantly*
> faster for many (not all I guess?) algorithms and applications.

I don't have any numbers, but I've got a strong suspicion that this is
almost entirely an issue of "programmer culture"; IOW, if you wrote a
O'Caml to Haskell compiler, and fed idiomatic O'Caml through that and
then GHC, the resulting binaries would be about as fast as if you used
ocamlopt (INRIA's native code O'Caml compiler); and conversely, Haskell
code translated naïvely into O'Caml would be no faster than before.

(I do have the case of my Unlambda compiler, which was somewhat faster
with ghc -O2 than with ocamlopt, but between CPS-conversion and the
complete lack of data types in Unlambda, the resulting code was
sufficiently unidiomatic in either language as to render my numbers
mostly useless).

> This will change with threading of course, but still if you've got a
> 1024-core Niagara 2012 machine, and the Haskell algorithm runs 65536 times
> as slowly as a single-core imperative GC'd language program, you're not
> going to see a significant speed-up ;-)

Just wait 12 years, and if the price of processors follows Moore's
extrapolation and the Haskell keeps its parallelism, Haskell will win :)

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20070809/e5148dc5/attachment.bin


More information about the Haskell-Cafe mailing list