Linux.com

Haskell vs. C++

Link to this post 25 May 09

> depends upon how the code is written

Then look at how the code is written!

The full source code, compile options and output is shown for all the programs.

Link to this post 25 May 09

Is there no way to compare "apples" to "oranges'?

Link to this post 25 May 09

> Haskell is a niche language, not a general purpose language. It is also an interpreted language...


GHC is a Haskell compiler.

You can see the compilation command and options in each programs "build & benchmark results" log, for example - http://shootout.alioth.debian.org/u32q/benchmark.php?test=spectralnorm&lang=ghc&id=1#log.


Here's a C interpreter - http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=cint - does that make C an interpreted language?

Link to this post 29 May 09

The hugely important distinctions are not in some performance benchmarks, but in the fact that Haskell is a pure-functional language, which makes it in general behave and feel much more different than your typical run of the mill imperative OOP language.

It makes you think rather differently about your solutions (not "how", but "what"), and I would suggest that a lot of functional-style solutions to problems are actually quite enlightening. In addition pure-functionality has important theoretical properties that make it much more amenable to something like data-parallelism due to lack of side-effects, for example...

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board