6 ms·
The issue with Haskell is that it doesn’t live up to the promise. The promise is that you learn this difficult language and you gain a higher-level, cerebral u
by zarzavat 2y ago
The issue with Haskell is that it doesn’t live up to the promise.
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.
- jordigh 2y agoLaziness in Haskell is so hard for me to understand. I never have any idea what the runtime performance of something I write in Haskell will be. It's either blazingly fast or molasses slow, and I can never tell.
- argiopetech 2y agoAvoid String, use Text or ByteString. Avoid [] for data processing, prefer Vector. Avoid lazy IO, use Conduit (or similar). Prefer newtype to data, and make data fields strict where appropriate. Make sure you're building with -O2 (has to be explicit, none of the tooling enables it by default). These rules cut out 99% of space leaks. The profiling tools are a big help for the last 1%.
- rowanG077 2y agoI generally don't care about perf. And if I do care about perf I profile. Which... Is actually the same thing I do in any other language.
- vanjajaja1 2y agoMy theory on Jazz is that it is the coffee palette cleanser for people who work too much with regular music patterns. The appeal is that it is not appealing
- pdpi 2y ago> The appeal is that it is not appealing 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
- vanjajaja1 2y agothat's fair, i'm not a jazz listener
- itishappy 2y agoMy experience is the exact opposite. I like jazz because it engages my brain, but it can be fatiguing. (One does not simply not count while enjoying Take Five!) Hit me with a standard 12 bar blues, or even a four-on-the-floor pop anthem, and we'll be back in business!
- vanjajaja1 2y agothis makes sense, the palette cleansing works both ways!
- raidicy 2y agoThis is kind of the thing that's stopping me from learning Haskell. My first language is javascript and my fluent language is python. And, I just can't see really getting any work done quickly, fastly, and efficiently not in either of these languages. 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.
- alabhyajindal 2y agoI'm currently learning Haskell and some mathematics (proofs, logic, sets). 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
- dagw 2y agoLearning Haskell was very useful to me, not because I became a Haskell programmer, but because it made me a much better Python programmer. Approach Haskell, not with the goal of becoming a productive Haskell programmer, but with the goal of getting immersed in a new way of thinking about programming and computation.
- rbanffy 2y agoThis is also why I recommend something completely different as your next language to learn - learning something completely different will open your mind and teach it to see patterns you previously had no idea existed, just because you couldn’t see them. Haskell is an enlightening experience not unlike your first Lisp.
- tsss 2y agoYou definitely gain a deeper understanding of software if you follow through. Of course, if you only do the learnyouahaskell.com tutorial there will not be much in there that couldn't be done in other languages. The real insights are not in the language itself (except for laziness and some other cool bits like levity polymorphism) but in the ecosystem of libraries and blogs. As for the type system preventing you from bugs, I agree that it doesn't really live up to the promise.
- shrimp_emoji 2y agoSo you're saying https://xkcd.com/224/ https://xkcd.com/224/ isn't true for Haskell?
- ddellacosta 2y ago> 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. 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
- ddellacosta 2y agoAlso, it's worth watching a bit of this talk (link at a particularly relevant time to start) because while Haskell is an "ivory-tower language," it is not _just_ an ivory tower language, and the people working on it are very much not just "a merry bunch of category theorists who had little interest in software engineering." https://www.youtube.com/watch?v=re96UgMk6GQ&t=802s 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.
- rowanG077 2y agoWhat bugs are introduced by laziness? I have been using haskell for years and never seen a bug due to laziness, I don't even see how it can happen. Only excessive memory usage in rare cases but that is usually quickly resolved.
- treesurgeon 2y agoJust mix nontrivial data structures with algorithms that iterate until numerical convergence. Team of experienced devs fought space leaks for weeks, project schedule crashed, directly caused by Haskell's lazy eval. Management and customers angry. Good times, good times.
- rowanG077 2y agoWith all due respect. That is not a bug. That's like saying python slowness is a bug or that you can write undefined things in C is a bug. It's just the way the language works. Besides in the worst case you slap `StrictData` on the relevant modules. In the worst of the worst case you disable laziness altogether with `Strict` for the relevant modules. Frankly if an entire team of professional haskell devs are chasing a space leak for weeks then something is going very wrong and it's not the use of Haskell.
- treesurgeon 2y agoComplete rewrite in julia solved it.
- rowanG077 2y agoGreat! If you had such a special use case that you'd use hyper specialized programming language for numerics like Julia to solve why choose haskell at all? This confirms there was something very wrong in that development team. It's like having to write a web application and choosing CUDA.
- treesurgeon 2y ago