Follow

Does anyone consider to be their most productive language? Tracing and debugging other people's code happens to be the most common thing I do (because writing expressive, stable, non-leaky abstractions is hard), but it's like pulling teeth in Haskell. If I understand correctly, I need to map into an IO monad (or whatever the hell you call it) just to print out some value in a function: how do you get anything done this way?

@2ck I find haskell to be the funnest language to work in.. I do not find it to be particularly productive, however, since it has far fewer libraries and support than other languages. So that means any projects i do in it get limited contributors and have a limited collection of libraries. Ultimately this makes it a less productive language for me and often rules it out as an option for new projects even when I would love to use it.

@freemo Oh, it's a kind of fun, and the fact that I have to slow down so much is evidence that I'm learning, but I worry that the kinds of questions I want to ask and the answers to them are just evidence that "I'm thinking about things the wrong way" and you "just don't do that in Haskell". I've sort-of gotten over that doing pretty basic stuff with IO requires using an abstruse mathematical concept, but it's frustrating that I have to jump through hoops in this type system to do what I want while I still don't feel I'm getting much out of that system (other than the intellectual challenge).

@2ck The IO aspect of haskell is a bit of a nightmare as you say. I think its the most annoying part for newcomers. It is the consequence of wanting a pure functional language and the reason why almost every functional language out there is not pure, most people feel the barrier isnt worth it.

It really just depends on what your doing if it has value or not I guess, but many would argue that the IO stuff is haskells biggest shortcoming.

@2ck functional programming is a fad that comes around every 20 years or so, driven by people who think mathematical proofs are more important than practicality.

Ignore it and it'll go away eventually - until the next iteration. If you're lucky though you'll only have to listen to the same claims that it's going to change the world twice, maybe three times in your career.

@2ck I don’t like to go around lecturing people, that they should use Haskell.

But you asked a concrete question and yes I consider #haskell my most productive language.

That being said, if I were optimizing my coding only for productivity I would maybe use another language and be more productive there.

Regarding your IO action problem: If you just use it for debugging you can use trace or unsafePerformIO. That's a totally fine quick solution. Just don‘t rely on it in production code.

@maralorn thanks for the tip. Admittedly, part of my complaints are just me working out an understanding of the language. I tend to hack my way through a language first, but I need to go back and read more documentation so I'll know about things like `trace` (I think I had seen it in a guide before but forgot about it)

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.