r/haskell • • Jun 12 '24

My talk "Functional Programming: Failed Successfully" is now available!

Hi folks,

My talk "Functional Programming: Failed Successfully" from LambdaConf 2024 is now published online.

This is my attempt to understand why functional languages are not popular despite their excellence. The talk's other title is "Haskell Superiority Paradox."

Beware, the talk is spicy and, I hope, thought-provoking.

I'll be happy to have a productive discussion on the subject!

https://youtu.be/018K7z5Of0k?si=3pawkidkY2JDIP1D

-- Alexander

71 Upvotes

93 comments sorted by

View all comments

Show parent comment

2

u/[deleted] Jun 15 '24

[removed] — view removed comment

6

u/SkippyDeluxe Jun 16 '24

Book "Production Haskell - Succeeding In Industry With Haskell" - Matt Parsons

The idea being that we don't have to pass command line information around explicitly, we use to Reader to hold it, and IO for everything else (IORef, Random...) After a lot of effort I think I understand the process - in theory, not in practice.

We can hold the information globally, I understand, using unsafe IO - but this is not idiomatic, and is still more complex than other languages.

The end result is that something that is easy in languages like C++, C#, Python, VBA, etc. becomes harder and more complex in Haskell.

Ok, I've read a little bit about this and let's just say I strongly disagree that you "need" Reader/ReaderT to handle program configuration. For some reason programmers are constantly trying to come up with more complicated alternatives to just passing parameters to functions, and I guess Haskell programmers are no exception. I'm sorry you've been caught up in this.

If the argument is that Haskell is "more complicated" because you can't use global variables to hold configuration, I think this argument is backwards. Where I work we use a command line flag library that treats flags as globals, and we need to constantly train new developers out of using them that way because of all the problems it causes. The fact that Haskell prevents you from doing this (or at least makes it much harder) is a great strength, not a weakness!

0

u/pthierry Jun 15 '24

Yes, maybe on some level, overall, Haskell is a bit more complex to learn than VBA or Python.

But the end product is just not comparable!

With Haskell and Elm, my team is able to produce software with zero exception raised at runtime in production. We had some exception raised once in a loop that forked a process and it didn't break anything else than that process, and I think it happened more than 18 months ago. I think that's the only time it happened in 3 years we've been using Haskell and Elm.

In every other codebase I've seen up close, you get exceptions raised on a regular basis, you catch them in staging in the debugger or in production in the logs. It's a normal part of development and operations.

Also, in my own experience, it's not harder to use, it's only harder to learn. Once you known ReaderT, or MTL, or Polysemy, or lenses, or advanced Haskell technique, using them is nice and simple.

Usually, with Haskell, I end up finding it easy to produce extremely efficient and robust software. The only hard part is learning, the DX is just awesome.