Learn Haskell for ... Haskell

    For a long time (several years) I did not dare to formulate a final opinion about Haskell'e: my thoughts were too contradictory. And finally, thanks to this record about parsing the graph bipartite determination program, I can do it :)

    I realized that Haskell programmers - basically, I must say, hobby programmers - are those who program non-solution of a problem, algorithm, system and Haskell! [1] Look at what a simple algorithm is described in the note, and how many language constructions, explanations and discussions are piled around it. (To understand how simple the algorithm is, you can look in the comments for options in Lisp, Python).

    I’m very familiar with this mentality - when in pursuit of the maximum use of the power of the language you forget about the task itself, because it is also often found in the Lisp world: there are languages ​​that can really captivate. And the expression “it blew my mind” often sounds both about Lisp and Haskell. But this is garbage! Of course, one cannot but rejoice at learning something new, but one does not need to rejoice at this, as a child does a new toy. A good programming language should be as clear and simple as possible, should give a person freedom of expression. Honestly, this is exactly what I was delighted with when I discovered Lisp: that I found what I was looking for. And not that I saw some kind of design or twist that I had never seen before.


    Haskell is a very interesting language that has both pros and cons. Pros: this is interesting semantics and a strong theoretical base, good binary execution speed, which modern compilers give. Cons: terrible syntax [2] , artificial limitation, which leads to the need to use complex approaches where they can do just fine. And they’re just worth it if you are interested in the topic of programming languages ​​as such, their development and research. Many other more practical languages ​​are taken from Haskell: a prime example of this is Clojure. But it is not for writing large systems or even for researching algorithms in the general case.In addition to syntax and semantics, programming languages ​​have a third aspect, perhaps even the most important one, which is often forgotten - pragmatics. How the language is used, what it is intended for, the way the community of its developers and users lives. Haskell’s pragmatism is that it exists primarily for research ... Haskell .

    Notes:
    [1] Of course, there are exceptional, most beautiful Haskell programmers who wrote a lot of useful code on it for the real world, but this, as I say in the aphorism that I don't like, only confirms the rule.

    [2] For the modern language, irregular syntax is disrespect for its users. After all, no one in the modern multilingual world programs in the same language, so you can not require a person to keep in mind the idiosyncrasy of everyone. And these common languages ​​will be more and more, and the amount of legacy code will not decrease. I am dealing with Lisp, Python, Php, C, JavaScript, Shell, Java. And this is not the most vivid example.

    PS. Initially, I raised the topic on my blog . However, I decided to bring it to a broader discussion, in order to hear the opinion of Haskell programmers on this subject.

    Also popular now: