Haskell Goodness

"Haskell is like a programming language from an alternate future that is never going to happen."

So says Matias Biilmann, quoted by Cade Metz in a 2015 Wired magazine article.

Alexis King in her blog in early 2018 observes that Haskell:

... is fun and it challenges me intellectually in ways that other languages don't. But that challenge is not a sign of uselessness; it is a sign that Haskell is so close to letting me do the right thing, to solving the problem the right way, to letting me work without compromises. When I write in most programming languages, I must constantly accept that my program will never be robust in all the ways I want it to be, and I might as well give up before I even start. Haskell's greatest weakness is that it tempts me to try. ...

Edsger Dijkstra writes in favor of teaching Haskell in a freshman computer science course:

It is not only the violin that shapes the violinist, we are all shaped by the tools we train ourselves to use, and in this respect programming languages have a devious influence: they shape our thinking habits.

In "Why Haskell Matters" there's a list of reasons why Haskell programs have fewer bugs:

  • Pure. There are no side effects.
  • Strongly typed. There can be no dubious use of types. And No Core Dumps!
  • Concise. Programs are shorter which make it easier to look at a function and "take it all in" at once, convincing yourself that it's correct.
  • High level. Haskell programs most often reads out almost exactly like the algorithm description. Which makes it easier to verify that the function does what the algorithm states. By coding at a higher level of abstraction, leaving the details to the compiler, there is less room for bugs to sneak in.
  • Memory managed. There's no worrying about dangling pointers, the Garbage Collector takes care of all that. The programmer can worry about implementing the algorithm, not book-keeping of the memory.
  • Modular. Haskell offers stronger and more "glue" to compose your program from already developed modules. Thus Haskell programs can be more modular. Often used modular functions can thus be proven correct by induction. Combining two functions that are proven to be correct, will also give the correct result (assuming the combination is correct).

And in a 2009-2010 discussion "What's the Fuss about Haskell?" somebody suggests:

... we have all these other programming languages, and they're all more or less similar, and then there's Haskell which is totally different and wacky in a way that's totally awesome once you get used to the wackiness. But the problem is, it takes quite a while to acclimate to the wackiness. Things that set Haskell apart from almost any other even-semi-mainstream language:

  • Lazy evaluation
  • No side effects (everything is pure, IO/etc happens via monads)
  • Incredibly expressive static type system

as well as some other aspects that are different from many mainstream languages (but shared by some):

  • functional
  • significant whitespace
  • type inferred

... the combination of all these features means that you think about programming in an entirely different way. ...

Oh, and Haskell is based on Category Theory ...

(cf Higher Level Language (2007-08-17), Category Theory Concepts (2016-04-25), Category Theory for Programmers (2017-05-12), ...) - ^z - 2018-07-15