6 ms·
It's a great language to learn as a gateway for language design, but I think what turns people off are unrealistic expectations. Haskell has warts, as do all l
by _huayra_ 6y ago
It's a great language to learn as a gateway for language design, but I think what turns people off are unrealistic expectations.
Haskell has warts, as do all languages. Something that's tedious in one language might be a breeze in another. In Haskell, most of the baggage I've seen is around
- Cabal: seems the best advice is to just start with Stack
- Delayed exceptions: due to lazy evaluation (which is a really great feature once you get used to it!), the site where you trigger an exception may not be anywhere near the actual exception-generating site. For example, if you call head on an empty list, then return that as a result only to have it be used far later, it will go "boom" at some later time. This is also true for I/O things: perhaps the file I/O way deep down in some thunk was closed due to an error, so some code that is not equipped to handle errors gets an exception.
Michael Snoyman has a great series of blog posts about this [0], i.e. "Haskell the Bad Parts 1-3". Most of this is managed by not using some of the defaults or with practice. Just be aware that like any language, there will be areas that may not have the greatest behavior.
That said, I think these confusing behaviors are very limited in Haskell, much more so than in C++ for instance.
[0] https://www.snoyman.com/blog/ https://www.snoyman.com/blog/
- revskill 6y agoStack on windows is a nightmare :( Cabal is good, cross-platform really.
- travv0 6y agoWhat problems have you run into with Stack on Windows?
- cies 6y agoIf you are interested in learning Haskell, do not start with Snoyman's blogs. They are good, but not something a true beginner should be bothered with. I can recommend the https://haskellbook.com https://haskellbook.com as an introducing resource. If you want to dabble with something simpler/cleaner than Haskell, try Elm. It is just for browser apps, but extremely powerful and beginner friendly. You do not even have to install anything when you use this online tool: https://ellie-app.com/new https://ellie-app.com/new
- latexr 6y ago> I can recommend the https://haskellbook.com https://haskellbook.com as an introducing resource. As a counterpoint, I found that book unbearably boring and abandoned it. I continue to be interested in Haskell so I may eventually pick it up again but I’ll skip (or at least skim) the first chapters. I followed the book’s development (written by a programmer and a novice) and had high hopes for it, so it was a great disappointment when I got to read it.
- cies 6y agoInteresting, such different experience. As it's hard to answer "what did you find boring", I want to ask you: which programming book did you find super juicy (opposite of boring) to read?
- progre 6y agoI had a bad experience trying to get into Elm. It's a nice enough language, but I found the community to be less nice. This was about when the version something.19 was released.
- tasuki 6y agoInteresting! Elm has by far the nicest programming community I've ever been a part of, specifically the Elm Slack[0]. All my stupid questions get answered immediately :) [0]: https://elmlang.slack.com/ https://elmlang.slack.com/
- the_duke 6y agoThe biggest wart for me is the complexity introduced by language extensions, many of which can significantly alter the behaviour and feature set. There is not one Haskell, there are many flavors of Haskell, and every file can be a different subset because extensions can be toggled by file ( `{-# LANGUAGE <Extension> #-}` ). My second biggest wart is the heterogeneous nature of the ecosystem due to lack of established paradigms, and the heavy use of complex type system abstractions in some libraries (plus the common lack of good documentation). I love Haskell as a language for the learning experience, but I would not use it in a professional/production environment.
- mightybyte 6y agoI agree with you that the many flavors of Haskell are problematic when it comes to uniformity. C++ and Scala have similar challenges. The old trope of every C++ shop using their own unique subset of the language is pretty relevant here. One thing in Haskell's favor though...with the language extension paradigm you have a very clear and tangible path to enforcing uniformity in your codebase that you don't have in C++ or Scala. You can use simple code analysis tools (I believe hlint already has this functionality, but just grep is sufficient actually) to enforce your team's choice of language extensions.
- agentultra 6y agoMany build tools also let you configure the common set of extensions. You shouldn't be forced to set them on a per-file basis. There's finally an effort to update the Haskell spec and many of the most common extensions are slated to be included so we won't have to use so many for "common Haskell" soon.
- the_duke 6y ago> There's finally an effort to update the Haskell spec That's great to hear! But in the future it would also be great if Haskell took a route similar to Rust. In Rust, extensions (called features) only work on the nightly compiler. On stable and beta compilers, they produce an error. Only once they are officially accepted and finalized will they work on stable. That gives both users and compiler/std lib developers the freedom to experiment, but prevents a proliferation of a complicated feature matrix and centralizes the ecosystem on a coherent language spec. This has worked out really well. In the early days many users were stuck nightly because of essential features, but by now libraries are expected to work on stable.
- nerdponx 6y agoMy "big turnoff" from Haskell is the highly disorganized standard library / Prelude. I'm aware that alternatives exist, but the terminological chaos of standard Haskell just reminds me of Perl and it makes me not want to use it.
- remexre 6y agoI think Cabal is "fixed" these days, at least on Linux and FreeBSD; it behaves approximately like Cargo now.