Hi there! Thanx for this great article! Btw, could you clarify the
issue about the presumed slowness of execution of Haskell programs,
compared to other languages (C, GO, and Python)? I would understand if
it could be real disadvantages in execution speed compared to the
advantages and power of Haskell implementation and maintenance of code
(check this: http://honza.ca/2012/10/haskel.... Thank you!
The link doesn't
seems to work, but I am pretty sure you are referencing a link for
someone testing a kind of big grep in Haskell.
So, the real answer is not Haskell is slow neither Haskell is fast.
just say that for most tasks Haskell is about 2x to 5x slower than C.
If you optimize your Haskell program (which can be hard for some tasks)
you will be about 0.9x to 2x the C time. So, yes, Haskell can be faster than C sometimes.
Let just say that, if you research speed, Haskell is very good for some domain, and perform not so good for some other.
major slowness issue is due to the garbage collection which block
everything. So mostly forget real time game, even if some exists, it
might be difficult to optimize correctly. If on the other hand you
consider making web development, Haskell is one of the fastest language
to use for this. It is very difficult to be confident in most
benchmarks. Let just say that Haskell is not as good as it should be for
them. Because Haskell web frameworks makes a _lot_ of more work
(protecting against XSS for example), comparing to most frameworks in
other languages. Nonetheless, Haskell is very good for web
development (and clearly faster than Python about 20x faster). And
almost nobody will take the risk in developing a web framework in C or
Furthermore, one thing that is difficult to pass in an article is what you really gain using Haskell:
incredible refactoring ability (this is really incredible but you must
program for some time to discover it). Like the matrix, you have to
discover it yourself. - Incredible trust in your programs. The type system is a lot for this, but also quickcheck. -
Incredible ability to think your problem at the right level of
abstraction. C,C++,Java... are not abstract enough. Scheme, LISP can be
too abstract and macros make some refactoring difficult to achieve. -
Rediscover programming, Haskell make it clear when a problem is
difficult. Most language hide a lot of difficulty and you find it later,
when your code is in production.
I hope had given a nice overview on when to use and not to use Haskell.
"Generally, in Haskell: “if it compiles it certainly does what you
intended”" -- this is not true with even simple code like "head ".
Figuring out whether a program is correct is in general as hard as
*running* it (i.e. 'undecidable').
This is probably the best Haskell tutorial I've ever gone through.
It's the sort of thing that loads your head with interesting stuff to
think about for weeks. Sure, the pace is quick but that only makes it
more exciting. If you've never had anything to do with Haskell but are
good at grasping new languages, this tutorial will get you up and
running in a fraction of time compared to a book-length introduction.