Better HN
topnewbestaskshowjobs
Log inSign up

montanonic

26 karma · joined Sep 8, 2016 (10y ago) · 7 submissions

Submissions

comment 9y ago · link · parent

If you add a new member to a type aren't you usually describing new behavior? Isn't it sensible to have to implement that behavior everywhere?

comment 9y ago · link · parent

This brings to mind what I consider to be perhaps the biggest issue with Haskell (I'm not accusing you of this, you've done a great job explaining): due to language expressiveness, overly generic code is far too often a baseline, when it really shouldn't be.

The language itself doesn't demand we write code this way, but the community, understandably, loves to be as expressive as possible in many cases.

But all of this comes with a cost of cognitive overhead that seems to rarely be worth paying.

Elm was an enlightening experience for me, having started with Haskell, because it helped me to realize just how little I ever took advantage of a lot of the very generic Haskell code, and how far the simplest of functions and types could take you in the overwhelming majority of cases.

comment 9y ago · link · parent

How to take over the world as a programming language community:

Neophyte: Hello, I do not understand this.

Haskeller: You should already know this.

comment 9y ago · link · parent

And yet the following is profoundly more intelligible to a wide range of functional programmers:

-- Using Elm syntax

pipeline : List (Int -> Int)

pipeline = [(\x -> x + 3), (\x -> x * 2), abs]

applyPipeline : Int -> Int

applyPipeline value = List.foldr (\func val -> func val) value pipeline

-- or more succinctly

applyPipeline_ value = List.foldr (<|) value pipeline

Getting lost in the mathematical abstractions is really no help here. In niche circumstances I'm sure it's great, but like.... not here.

comment 9y ago · link · parent

Honestly, I think for a lot of people who've used both Haskell and Elm, the answer is pretty clear: lots of Haskell in the wild can be very hard to read and think about, even with significant time invested in it; and when it simple to read, it's likely not using many more features than Elm is. Yet, even with a very strict subset of its features, it is a very expressive language: sum and product types are an incredibly powerful concept; I'm blown away by how much more straightforward managing state is with them. Expressive types and superb type inference generally make refactoring a breeze. There are just many huge wins overall.

But you can have the bulk of these wins in a simpler language like Elm, or a language like Rust which tries to only add more type complexity in cases where it would significantly improve code in practice, rather than in theory.

Haskell is necessary; it pushes the state of the art forward because of how experimental it is (compiler extensions). But it's pretty clear that the community is skewed towards research rather than industry, and culture strongly influences what a language is practically capable of.

This does not at all mean that Haskell isn't fully capable of industrial applications; we have direct evidence suggesting otherwise. But with a philosophy to "avoid success at all costs", it should be fairly clear that moving out of the realm of obscurity isn't exactly a goal of the language.