by zarzavat · 2y ago · 0 comments
The promise is that you learn this difficult language and you gain a higher-level, cerebral understanding of software, and the type system protects you from bugs.
The reality is that you realize that this language was designed by a merry bunch of category theorists who had little interest in software engineering. The effort put into different parts of the language is super unbalanced. GHC is an impressive feat of compiler engineering. But the other tooling is poor, and so is support for basic features such as records.
Whatever extra bugs are caught by Haskell’s elaborate type system that wouldn’t be caught by a simple type system like Java’s, are replaced by bugs introduced by laziness.
Jazz is a bit different. Non-musicians generally don’t enjoy it. The more knowledge you have of Jazz the more you appreciate it.
> Whatever extra bugs are caught by Haskell’s elaborate type system that wouldn’t be caught by a simple type system like Java’s, are replaced by bugs introduced by laziness.
I think you're simply wrong. I've been writing software professionally for almost 30 years: say what you will about Haskell's weaknesses, I've consistently found it to provide a better _software engineering_ experience than most other languages I've used. The only thing I think comes close is Erlang/Elixir, and even then I miss the sophistication of Haskell's type system all the time--the ability to make a change one place and have the type checker tell me so much about where else I need to make corresponding changes is invaluable.
Feeling constrained in what I can express because the type system forbids it almost always leads me to realize a logical fallacy in how I've been considering a given piece of code. And yes, Haskell records are bad in a lot of ways, but it still isn't enough to make me throw the baby out with the bathwater, and the existence and utility of row polymorphism in PureScript in my mind dismisses the notion that this has something to do with the type system.
In fact I think this article is frustrating and off base because I value Haskell so much for its ability to help me write useful, maintainable code; I don't care about esoteric extensions or type-level programming other than how much it enables me to solve problems.
I don't get why so many people have the attitude about Haskell that you do. I think a lot of people bounce off of it but this is not the same as asserting that it doesn't live up to the promise--it does, and then some, as far as I'm concerned.
Then again, I was also a jazz performance major
https://www.youtube.com/watch?v=re96UgMk6GQ&t=802s
This talk is seven years old btw. Caring about industry users in Haskell is not new.
Haskell has the worst support for records of all its peers. SML, OCaml, F# all have better records.
Without good records it’s unreasonably hard to write large software projects. Just look at any Java code, what’s it full of? class declarations. What’s C code full of? struct declarations. What’s JS code full of? object literals. Structures are a critical part of any programming language. A significant part of all code involves declaring structure types and marshaling things in and out of structures.
One of the issues is that Haskell added a lot of type system features without thinking how they’d interact with records. AFAIK it’s hard to retrofit ML-style structural subtyped records onto Haskell, because the type system is designed around that not being possible. But they could still have much better nominal records.
I love Haskell, it’s frustratingly close to being a great language, but it needs a push to prioritize developer experience.
There has been an incredible amount of work over the last decade put into all the things you mentioned, which it sounds like you're unfamiliar with. https://github.com/haskell/haskell-language-server in particular is a pleasure to use in my experience. Package management is far from perfect, but it's always being worked on and I'll take it over anything in Python or the Node.js ecosystems any day. Developer experience has improved a lot since I started using the language and this is an area that the community and leadership absolutely cares about--I'd be surprised if anyone spent time reading relevant discussions in https://github.com/ghc-proposals/ghc-proposals or https://discourse.haskell.org/ or etc. and agreed with you.
> Haskell has the worst support for records of all its peers. SML, OCaml, F# all have better records.
> Without good records it’s unreasonably hard to write large software projects.
> AFAIK it’s hard to retrofit ML-style structural subtyped records onto Haskell, because the type system is designed around that not being possible.
Haskell is not ML, and while Haskell records are weak they are not what is preventing people from writing big projects in Haskell. There is much more to the language than records. But I said this in my previous comment.
Nothing you've written resonates with me, and I've written Haskell and PureScript professionally as well as Java and JS along with a bunch of other languages that haven't been mentioned. I'm also actively working on an open source project in my spare time with thousands of lines of Haskell and PureScript code (https://github.com/ddellacosta/automation-service), not to mention a half dozen other random half-done projects and contributions I've made to other open source libraries and applications. What have you written in Haskell that has made you dislike it so much?
> Talk is cheap.
Yes it is.
What is the popularity of it via surveys?
Regardless, this has nothing to do with what I wrote in the comment you were responding to, so I'm not sure what your point is in raising these questions.
That's a bit reductive. Jazz covers a lot of ground from Dave Brubeck[0] to Sons of Kemet[1] to Mopo[2] to Hiromi[3]. There's very different reasons to find each of them appealing.
0. https://www.youtube.com/watch?v=tT9Eh8wNMkw
1. https://www.youtube.com/watch?v=0mu1FHeNkpo
2. https://www.youtube.com/watch?v=m94-ih0gf7k
3. https://www.youtube.com/watch?v=QU2893TnTbU[1] http://h2.jaguarpaw.co.uk/posts/make-invalid-laziness-unrepr...
[2] Here's a space leak I fixed two years ago in a popular library by making invalid laziness unrepresentable https://github.com/mrkkrp/megaparsec/issues/486#issue-135418...
As for the type system preventing you from bugs, I agree that it doesn't really live up to the promise.
Even though I am studying category theory right now I feel I have so little incentive to learn Haskell because I don't think I'll ever use it except with category theory. And I get that category theory is kind of like native to Haskell but I could still explore those concepts in a lisp but that compiles to Javascript or something.
My concrete example is the Haskell Web framework IHP. I tried to get it working on my windows machine for two days and couldn't get anything smooth to work. Granted I have rsi and cannot use my hands as much as the next developer. However, when new frameworks like fastHTML pop up where everything is on one python file and immediately ready to go, It's really hard to convince myself to go through the trouble and pain to get to the same spot with Haskell as I can with another language immediately.
I think Haskell's great. I got over my hesitation to learn it by accepting that it's a useless language. I just treat it as an intellectual exercise.
Web programming is very important and useful. Haskell is ill suited for it and it's ecosystem around it is very weak. You make a great point comparing it's experience with other options.
Post admitting Haskell's uselessness, I would put web programming towards the end, on a tier list of things to do with Haskell. If one of the goal is having a fun experience.
EDIT: Added more info
These rules cut out 99% of space leaks. The profiling tools are a big help for the last 1%.