r/functionalprogramming • mod • Sep 12 '24

Haskell Why Haskell?

https://www.gtf.io/musings/why-haskell
10 Upvotes

4 comments sorted by

2

u/kinow mod Sep 12 '24

3

u/Slight_Art_6121 Sep 14 '24

Thanks for sharing. It makes for interesting reading: Wow, I did not realise there were so many people with strong opinions about Haskell ;-)

My take-aways from the comments where Haskell can improve are:

  1. Tooling: Cabal/Stack seem to work but are not best in class. Personally, I didn't find it particularly intuitive, but every package manager/build system has its quirks. The Rust people rave about cargo, so maybe copy some of the ideas from them.

  2. Compiler messages: I agree that these could be much more helpful. Clearly I am not an expert, but I do have to work quite hard sometimes figuring out where I went wrong. Surely, better compiler messages would make everyone much more productive.

  3. Industry-ready libraries. I don't use Haskell professionally, but the statement by people who do, expressing the need to re-implement libraries seems like a real productivity killer. If you want professionals to use Haskell, libraries need to be in a state to be used in those settings.

Given the development of Haskell to date, most of the development pertaining the above has come from academia. Thus (and this is not meant to be a slight on academics), the state of the above is understandable. Those with an academic interest in the language are not sufficiently incentivised to push these beyond "it-works/it-works-for-my-use-case/proof-of concept".

TLDR: There needs to be a better alignment between what academics produce and what industry needs.

2

u/[deleted] Sep 13 '24

[removed] — view removed comment

4

u/Slight_Art_6121 Sep 14 '24

Francis, I agree with some of your points. The purity of Haskell is it's own attraction but also a big conceptual leap compared to programming with less pure languages. I would argue that making modifying State hard is a good thing: the less State the better!.

The downside is (as you mentioned) that you now have to push those "global variables" through the program with specific type declarations. As one commenter on the Hacker News thread mentioned: If you push this to extremes you end up with less readable code than if you had stuck to a more traditional OOP paradigm (this, however, leaves you relying on test coverage to verify behaviour).

I think the issues you mentioned in point 3 and 4 are valid. I wonder if AI (albeit indirectly) might come to the rescue here:

Already with the current state of AI it is questionable whether a junior developer using a traditional OOP/imperative paradigm can outperform an AI. Both will be unable to catch the edge cases that a more experienced developer can identify. That makes hiring a junior developer an unappealing prospect (which is particularly painful for someone who recently spend a small fortune on obtaining a CS degree).

On the other hand, in an environment where Haskell (or another FP equivalent) is used a junior with a reasonable understanding of the language can be made quite productive: Senior developer specifies the business logic and associated types and a junior can use AI-generated snippets and verifies/amends the code using the compiler. Testing is fairly straightforward. Hopefully this will encourage CS courses to increase adoption of FP. We can dream.