Live data from Hacker News

Pedagogical Downsides of Haskell

ciobaca.substack.com

41–50 of 118 posts

Re: Pedagogical Downsides of Haskell

#41
post #10

I find the go pattern absurd. Which of these is easier to read: foldr k z = go where go [] = z go (y:ys) = y `k` go ys or foldr k z = foldr_k_z where foldr_k_z [] = z foldr_k_z (y:ys) = y `k` foldr_k_z ys

How about 'folding'? I've settled on that kind of name for looping/recursing helper functions.

Scheme has a bit of syntactic sugar called "named let" which makes this internal-helper pattern more concise/direct.

Re: Pedagogical Downsides of Haskell

#42
post #17

Earlier quoted context omitted.

I find so many things about this line of reasoning wrong that I don't know where to start. So let's just pick one thing: Haskell does not ignore the physical reality of the machine. It's one of few languages that explicitly recognise it. There are more facilities in Haskell to deal with this reality than in almost any other language you can think of.

Do you think Haskell recognizes the physical reality of the machine more than C does? If so, how specifically does it do so?

Technically, within the language, yes. C itself simply delegates a lot of logic to the "physical machine"[1] by leaving it unspecified or implementation-defined. In contrast, Haskell actually tries to model these differences within the type system and standard libraries, with IORefs, STMs, and whathaveyou.

(In fact, I just checked the IORef documentation and it actually references the x86/64 architecture manual to explain some of the behaviour that can be expected. I would be surprised if any part of the C standard did that.)

[1]: I mean, if we're using an x86 derivative we're still talking about a very fancy PDP-11 emulator.

Re: Pedagogical Downsides of Haskell

#43

I find its syntax & idiomatic style incredibly difficult to follow, in a way nearly no other languages have been for me, including some functional languages (OCaml doesn't seem nearly as bad to me, for instance). It's sometimes implied that those who trip over Haskell just aren't big-brained enough to understand various important concepts related to it, but I've found they're usually very easy to grasp, provided the…

I find the terminology that Haskell uses quite misleading for software engineering. It borrows concepts from category theory with quaint names such as a "monad", "endofunctor", "catamorphism", etc. The problem is that, instead of a "monad", we can say "brrrdogcogfog" and nothing will change -- the name is absolutely irrelevant to the problem being solved. Given that a monad is an interface for sequential computation, a much better name would be something like "Seq", "SeqComp", or something like that.

Re: Pedagogical Downsides of Haskell

#44

Earlier quoted context omitted.

I'm sorry to break it to you but every single programming language in existence ignores the physical reality of the machine. That's the point of abstractions such as programming languages.

Also true. Their point is that Haskell's system ignorance goes much deeper than its peers.

I mean yes, it's a higher level language. Python's system ignorance goes deeper than, say, Ada's, which in turn goes deeper than C++'s, which goes deeper than C's, which goes deeper than many of its predecessors, which go higher than x86, which goes deeper than PDP-11, which goes deeper than logic gates, which go deeper than transistors.

But what's the point? Which languages do we reject because they are sufficiently dissimilar to transistors? Should we all start writing code in VHDL?

Re: Pedagogical Downsides of Haskell

#45

Earlier quoted context omitted.

I'm sorry to break it to you but every single programming language in existence ignores the physical reality of the machine. That's the point of abstractions such as programming languages.

There are abstractions which build on the inherently stateful nature of computers with their instruction pointers, registers, memory and peripheral devices, and there are abstractions which coerce you into framing any computational problem like a mathematical formalism.

Haskell's abstractions build on the inherently stateful nature of computers – how do you think Haskell compilers do their job?

(Not to mention that Haskell and its base libraries have plenty of abstractions useful also for the programmer to deal with the inherently stateful nature of computers, e.g. the IO type, STM, State (it's in the name!), Channels, etc.)

Re: Pedagogical Downsides of Haskell

#46

I find its syntax & idiomatic style incredibly difficult to follow, in a way nearly no other languages have been for me, including some functional languages (OCaml doesn't seem nearly as bad to me, for instance). It's sometimes implied that those who trip over Haskell just aren't big-brained enough to understand various important concepts related to it, but I've found they're usually very easy to grasp, provided the…

My original degree was in Math and I can definitely 'feel' a difference when reading Haskell vs other languages.

Writing/Reading Haskell gives me a similar feeling to doing proofs than programming.

Even other functional programming languages don't give me that 'in the math class' feeling that Haskell does.

Re: Pedagogical Downsides of Haskell

#48
post #5

Point 11 surprised me. Not the “go” thing but the “where” syntax – I wish more languages had it!

Yes. Where is often lovely -- I want to delegate details, and not think about them yet, but keep that delegation scoped to the function that needs the relevant details.

But calling auxiliary functions "go" is almost always bad naming.

Re: Pedagogical Downsides of Haskell

#49
I think Elm is second to none as a tool for learning FP.

It compiles quickly, the guidance offered in error messages are best in class, it's small, and the mental model is consistent.

In fact I think it's far easier to learn Elm (and also perhaps web UI development wouldn't be such a shitshow if programmers earlier in their career used Elm to build their mental model) than it is to learn:

- React

- Redux

- Immutable.js

- Lodash/Ramda

- ES${CURRENT_YEAR}

- Webpack/Parcel/Grunt/Groan/Whatever

- etc…

I've seen so many early programmers go through some React course thinking they've learned FP, and yet struggle to solve basic problems by applying functions to values.

Re: Pedagogical Downsides of Haskell

#50

I find its syntax & idiomatic style incredibly difficult to follow, in a way nearly no other languages have been for me, including some functional languages (OCaml doesn't seem nearly as bad to me, for instance). It's sometimes implied that those who trip over Haskell just aren't big-brained enough to understand various important concepts related to it, but I've found they're usually very easy to grasp, provided the…

I find the terminology that Haskell uses quite misleading for software engineering. It borrows concepts from category theory with quaint names such as a "monad", "endofunctor", "catamorphism", etc. The problem is that, instead of a "monad", we can say "brrrdogcogfog" and nothing will change -- the name is absolutely irrelevant to the problem being solved. Given that a monad is an interface for sequential computation,…

Like a Javascript ArrayBuffer? No, a Stream?
Post reply on HN