[Haskell-cafe] Why Haskell is beautiful to the novice

James Crayne jim.crayne at gmail.com
Tue Sep 1 11:02:50 UTC 2015


I think early on in the development of the language, a decision was made
that it was nice if we can express the concepts in a way that was close to
how we would on paper, even if it meant that the parser can or would be
very complicated. A decided break with the lisp crowd was made in this
respect. Initially, i think, even performance was considered a distant
second to this.

Also, what we tend to call "abstract" is actually often just "cleaned up"
as in, we are using the word as a euphemism for "clutter removed".

Somewhat worryingly, but also understandably, the stress and emphasis
placed on these values has actually lessoned over time, due to other
important values becoming greater.

As language creators, we set the tone for the entire industry, or at least
everyone working in our language. As a result, I would argue that people
who program in haskell place a great deal more energy and care into how
they express their code.

Haskell for a long time was used primarily by academics, and their
students, so arguably its primary purpose was this expression, where as
most other languages are invented for purely practical reasons and dwelling
on exactly the right syntax might have been seen as a sort of endless bike
shedding to be avoided, so that ultimately the practical concerns are
addressed.

There are likely some objective measures of clutter even without knowing
the specific problems at hand. How much do unrelated concepts blend
together in the text, and so on. In c and c++, you really have a bit of
boiler plate on every program, you can see this by comparing "hello world!"
in these languages. Naturally, all those tokens on the screen that must be
included in every program have very little to do with the actual underlying
algorithm, or functionality.

Consider what the equivalent of sum types and product types and sums of
product types look like in these languages. I think a very strong case can
be made that Haskell is _objectively_ more "beautiful" than these
languages, and if I am correct, even a complete novice will be able to
discern this, given the examples to demonstrate.

James C

On Thu, Aug 27, 2015 at 9:08 PM, Olaf Klinke <olf at aatal-apotheke.de> wrote:

> Dear cafe,
>
> please correct me if questions like this should not go via this mailing
> list.
> Presumably everyone on this list agrees that Haskell stands out as a
> beautiful and pleasant language to have. The recent nitpicking and
> real-world problems like cabal hell don't change that. However, statements
> supporting Haskell's beauty usually involve: "In Haskell it is so much
> clearer/easier/faster to ... than in another language." That is, the beauty
> of Haskell presents itself to those who can compare it to other imperative
> or not strongly typed languages that one learned before Haskell.
> My question is, for what reason should anyone not acquainted with any
> programming language find Haskell beautiful? Maybe it does not look
> beautiful at all to the novice. The novice can not draw on the comparison,
> unless he takes the effort to learn more than one language in parallel. The
> novice likely also does not have the mathematical background to see the
> beautiful correspondence between the language and its semantics. (My reason
> to love FP is because it is executable domain theory.) One might argue that
> it is not the language itself that is beautiful, but rather the concepts
> (data structures, algorithms, recursion) and Haskell does a great job to
> preserve their beauty into the implementation. Do you agree?
>
> Disclaimer: I am about to start teaching a first course in computer
> science in secondary school. I can teach whatever I want, since this is the
> first CS course the school ever had. I want to teach beautiful things. I
> love functional programming. I need not start teaching programming right
> away. But I am reluctant to expose the pupils to something whose beauty
> escapes them completely.
>
> -- Olaf
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150901/41d661e4/attachment.html>


More information about the Haskell-Cafe mailing list