News for hackers. Stuff that matters.
Re:Dhall: A Gateway Drug to Haskell by Karrot_Kream on Tuesday June 07, 2022 @05:23PM (#31660245)
> I wonder if the first point is due to a paradox of advanced tools.. society lives around "how do you assemble teams to solve big problems", they need organization tricks more than logic/language ones. That's why RoR, go, etc win, they allow most groups to end up with something workable. Haskell and the likes are more about exploration.. not tending to companies needs for profits.

I feel like "not tending to companies needs for profits" is a way to elevate Haskell and monadic FP abstractions with appeal to conspiracy/(postmodern) ideology. I don't mean this to be a pro-or-anti capitalism sentiment, but the excuse here is that "in a more just/less captalist/<other> world, Haskell would be a great tool, but our flawed world makes it not so" and I disagree with that. I just don't think Haskell is that good of a tool regardless (and I see the Haskell community these days appealing to this take a lot, trying to blame anyone but themselves.)

I think that people genuinely don't derive much value from Haskell and monadic FP. My experience, having written and maintained non-production-grade Haskell code, has been that the community is obsessed with toys and small examples, derives a lot of pleasure from clever abstractions which don't materially affect development (like Lenses), and most importantly doesn't really care about shipping software. There's exceptions like SPJ and Joey Hess who definitely ship useful Haskell, but the community doesn't care nearly enough about making it easy to actually produce software that a non-Haskell enthusiast would care about using.

Libraries are often created for a Masters project and abandoned. Even if a library works, debugging edge cases is never thought of. Almost nothing is written about testing in Haskell. No two libraries can agree on which monad stack to use, so a non-trivial amount of integration code involves matching and lifting into other monads (nor the performance implications of doing all of this matching and lifting). There are very few examples of organizational patterns for Haskell codebases for folks trying to create a project other than GHC itself, Pandoc, and perhaps XMonad. The community loves talking about abstractions and unifying concepts but doesn't really seem to have any practical tips about writing software. The string types in the language are confusing and poorly differentiated. The cabal and stack split is confusing and makes no sense to outsiders. The weird cargo-cult obsession in the community about category theory from people with little formal mathematical knowledge is bizarre. I can go on and on, but I don't want to dunk on the language endlessly (and I can certainly do this to any language I've used in love or anger :)

Fundamentally I don't think Haskell offers the programmer much more than what you'd get out of a language like Rust, Java, or Go (yes even Go) as the GP said. It's a language with a lot of interesting concepts that's fun for folks who like to solve algebra problems and is certainly a clean introduction to monadic FP. I'm looking forward to a successor that takes its concepts, cleans them up, and offers a way to write actual software with them. Then again, Multicore Ocaml is landing soon...

Re:Dhall: A Gateway Drug to Haskell by pyrale on Tuesday June 07, 2022 @07:40PM (#31661402)
Several of the issues you talk about are true enough, especially the ones about the community not making it easier for newcomers to get the ropes.

The reason for that is that people who do haskell for a living are dwarfed by the hobbyist community which makes them invisible, and they're spread thin on maintaining the ecosystem. GHC, HLS and all the other good things there are are the work of people on their free time, while other, more successful languages simply have companies dedicating time, money and contracts to tooling.

All of that means that it's not easy to move from the hobbyist haskeller group to the paid haskeller group. Most people usually get there by getting hired in a place where the stack, library choices, etc. are made by people who had done haskell professionally before and have solved the problem you cite for the team.

Once you're in, the benefits of Haskell are tangible, otherwise people would stop using it, and there wouldn't be a professional community. That is not to say that there are no problems, it's just that they are different problems, and people that stick to haskell for their job usually do it as a tradeoff.

Re:Dhall: A Gateway Drug to Haskell by Karrot_Kream on Tuesday June 07, 2022 @08:40PM (#31661844)
What are the problems y'all see in production then with Haskell code? I'm curious since I never ran my code in a prod setting so I don't know what one cares about when operating Haskell code.
Re:Dhall: A Gateway Drug to Haskell by pyrale on Wednesday June 08, 2022 @02:56AM (#31664201)
Honestly, the problems I had with Haskell were mostly related to organization rather than tech. How recruitment would happen. What rules we would set in place to make sure the codebase didn't become overcomplicated. How to make sure people don't get engrossed in tech and neglect the business aspect. How to make sure a large part of the codebase is mundane enough that newcomers can contribute on it quickly.

The tech itself really works well, but it required either an org mature enough to do the things correctly, or a shop purely focused on haskell that would accept the complexity.

Also, sometimes the library ecosystem is a bit lacking. It wasn't an immovable roadblock, but we did write stuff that may have been available as a lib in other languages. This was a minor impediment for us, but it can get bad in other contexts.

Re:Dhall: A Gateway Drug to Haskell by unhammer on Wednesday June 08, 2022 @02:36AM (#31664066)
That would be a nice "ask hn" :-)
Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @02:48AM (#31664142)
> Most people usually get there by getting hired in a place where the stack, library choices, etc. are made by people who had done haskell professionally before and have solved the problem you cite for the team.

That's very true and the case at my job. We've taught people with 0 Haskell experience to write useful production code in under a month.

Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @02:44AM (#31664113)
This comment has a lot of facts wrong.

> Even if a library works, debugging edge cases is never thought of.

Many libraries use sum types to express their api which naturally leads one to consider edge cases.

> Almost nothing is written about testing in Haskell.

Yes there is! Did you verify your claim with a quick search? Here's what one gave me:

- https://mmhaskell.com/testing/test-driven-development

- https://jaspervdj.be/posts/2015-03-13-practical-testing-in-h...

Heck, here's one from 2007:

https://www.jasani.org/posts/2007/unit-testing-with-hunit-in...

It feels like this web of lies about Haskeller's not caring about real world concerns is being spun, but even with minimal effort that is trivial to disprove.

> No two libraries can agree on which monad stack to use,

The mtl library is the most used monad stack by far and it's not typical to see others very often.

> so a non-trivial amount of integration code involves matching and lifting into other monads (nor the performance implications of doing all of this matching and lifting).

I feel this may betray a lack of understanding because lifting between monad stacks is expected.

I agree there are performance implications on theory, but if you get out of the performance ivory tower you'll find it doesn't happen much in the real world ;)

Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @02:33AM (#31664045)
> derives a lot of pleasure from clever abstractions which don't materially affect development (like Lenses),

Oh but they do materially affect development in the same type of way LINQ does for C# programmers.

Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @11:07AM (#31668429)
Good examples in "Putting lenses to work" by John Weigley:

https://youtube.com/watch?v=QZy4Yml3LTY

Then for a great book that gives a great understanding see Chris Penner's amazing and fun "Optics by example:

https://leanpub.com/optics-by-example