[HN Gopher] Courting Haskell ___________________________________________________________________ Courting Haskell Author : honzajavorek Score : 38 points Date : 2020-01-14 12:47 UTC (1 days ago) (HTM) web link (honzajavorek.cz) (TXT) w3m dump (honzajavorek.cz) | ssivark wrote: | Though I'm not much of a Haskell programmer (spent some time | learning it and writing toy programs), I would use a different | motto to characterize Haskell: _Stop prescribing (loose) design | patterns; make them tight and refactor them into libraries, so | they need only be written once._ | | More than anything else, the language aims at providing | modularity (and terseness, on the macro scale) for the programmer | (while trying very hard to compile to something efficient). Even | laziness is to enable more modularity. | | The "make design patterns tight" part is what ends up needing | abstract mathematical reasoning (category theory is basically | mathematical pattern reasoning distilled to its essence). | | The other consequence of abstracting patterns into libraries is | that novice programmers end up with a lower "writing code" -vs- | "reading+thinking" ratio compared to other languages. And this | can be jarring to folks whose attitude is to learn by writing | code (to discover patterns in the process). | proc0 wrote: | " Powerful! It takes just a few lines to implement your own clone | of Vim:" | | Uh, ok lol. | | " If SQL or Python read like an English sentence, then Haskell | reads like math. Feels like math. It is math. " | | This is basically why there's a learning curve. Any analogy used | as a learning example will typically fall short because in order | to fully grasp the concepts you just have to learn the math | behind it, because that's by design (denotational semantics). | alexashka wrote: | Learning Haskell to write better software is like learning the | language of the Eskimo and their elaborate vocabulary surrounding | snow, only to realize most of the world doesn't have snow and | that real progress is made by science, not linguistics. | sanqui wrote: | And wait until you discover the Eskimo languages does _not_ , | in fact, have hundreds of words for snow. It's a myth. | | http://www.lel.ed.ac.uk/~gpullum/EskimoHoax.pdf | alexashka wrote: | 'elaborate vocabulary surrounding snow' != 'hundreds of words | for snow' | christiansakai wrote: | This fits my experience. But then I am only an average | engineer. | hopia wrote: | Ironically, Haskell pioneers exactly in programming scientific | research while the rest of the languages focus more on the | _linguistics_ rather than the science. | alexashka wrote: | Haskell is the epitome of linguistics - it took a bet on an | arbitrary set of conditions - lazy evaluation, immutability. | | These linguistic choices inform the rest of the language - | monads were only invented as an escape hatch out of the | prison the language designers put themselves into! | | If you think we ought to spend some more decades researching | how to walk using our hands instead of our feet for getting | around and are excited about the upcoming scientific | literature regarding hand strength exercises required and all | the rest of it, no problem. Most everyone else is walking | using their feet just fine - they are solving other problems, | namely real world problems that involve walking places. | youerbt wrote: | Ah, the classic - "we are producing REAL software over | here". | | Always reminds me of this: | https://steenschledermann.files.wordpress.com/2014/05/no- | tha... | alexashka wrote: | I'm not sure you comprehend my point - monads, lazy | evaluation and immutability by default _are_ square | wheels. | | Pointers and direct access to hardware memory _are_ | smooth wheels on top of which, all modern software | including languages have been built. | | Haskell is like trying to fly by trying to imitate birds | because it seems like a good idea. Meanwhile we have | metal planes in the sky. | | It could very well turn out that Haskell is like nuclear | fusion and C and C++ are dangerous nuclear reactors that | sometimes cause Chernobyl. It's been 3 decades - I've | used Haskell and I see no reason to believe that a | complicated, hard to reason about evaluation model and | even more complicated type systems are the way forward in | PL design. | hopia wrote: | Walk all you want, meanwhile Haskell is developing ways to | fly. | honzajavorek wrote: | In the past two months I've been trying to learn the Haskell | programming language. It's vastly different from anything I know, | so it served me also as a way how to empathize with complete | beginners to coding. This is a diary from my journey. | crimsonalucard wrote: | A different way of thinking of abstraction or just a feeling of | elegance or a feeling of power is not a sufficient explanation | for why Haskell is so great. | | People want definitive and theoretically correct answers not | talking points for a philosophical debate on programming styles. | | Why is typed functional programming measurably better than | procedural? Why is it better than OOP? Definitive answers are in | demand not exploratory experiences. | solomonb wrote: | Why does "Typed Functional Programming" have to be measurably | "better" then OOP or procedural programming in order for | Haskell to be considered a good language? | | All those questions at the end of your comment can be turned | around the other way and are equally valid and unanswerable. | avindroth wrote: | no mention of haskellbook.com is surprising! | olah_1 wrote: | I read that book for 6 months straight, followed all the | exercises, and quit when I realized I couldn't write a simple | script that did something useful. | | But boy did I sure evangelize Haskell throughout the process! | _facepalm_ | hopia wrote: | I started building straight away from day 1, getting a decent | REST API together is surprisingly easy. You really don't need | to understand most of the advanced type level stuff to stay | productive. | | Maybe you tried to go for too high abstraction level straight | off the bat? That can turn out very depressing on Haskell. | solomonb wrote: | HPFFP was the book that finally made the language 'click' for | me. It took 13 months to complete and only towards the very | end did I start to get an understanding of how to structure | an actual program larger then a leet code exercise. | | Its a _really_ different language from what I was used to | (Javascript, Python, Ruby, etc). The book covered a lot of | material that felt very basic to me, but interspersed with | that was material that covered concepts I had never even | considered, this was the case in the early chapters as well | as later on. | | I found that the early chapters setup lots of concrete | examples that later on would be revealed as simplified cases | of highly abstract structures that occur all over the place. | Uncovering these is a very magical experience. For that | reason alone, I tell people to just grind through the book | rather then skipping ahead to the more exciting material | later on. | | But you don't have to like HPFFP or Haskell, nobody has to | like anything. For me, Haskell is a joy to use and provides a | seemingly never ending source of learning material to | explore. | ggm wrote: | At last! somebody else who is prepared to be honest about their | fear of maths, and mathematical notation, and people who leap | from "its just like school maths" to referring to the | intimidating maths you skipped or failed in school and | university. | | Its just like maths: requires deep brain structure wiring you may | not have. | alephu5 wrote: | I've been been learning haskell by building a standard monolithic | web application: Postgres DB, some static content, REST API and | firebase authentication. It's taking longer than it would with a | familiar language but so far I'm really enjoying the experience. | I also took a small deviation a couple of weekends ago to build a | simple OSM router and was pleased with the ease of development | and performance. | | I'd recommend the book Practical Haskell by Alejandro Serrano | Mena to get a firm introduction to the language and ecosystem of | web applications. After that take at look at the libraries | developed by FP complete. | hopia wrote: | I'm using the same method as you. What are you using as the SQL | and REST API libs? I'm using Servant and a library called | Squeal for Postgres. | Rerarom wrote: | You keep mistyping Clojure as Closure | cdaringe wrote: | To the whole article I say "ditto." Great summary. Also, didn't | Guido say he wanted to eject the functional operators in Python? | #hearsay | sli wrote: | Slashdot had an interview with him where he talks about it[0], | he basically says Python isn't the language for FP and then | complains about readability which, YMMV on that one. I don't | know if his opinion has changed in the last seven years, | though. | | [0]: | https://developers.slashdot.org/story/13/08/25/2115204/inter... ___________________________________________________________________ (page generated 2020-01-15 23:00 UTC)