Hacker News new | ask | show | jobs
by xyzzy4 3397 days ago
Haskell is a bad language, in my opinion, because you can't tell what the O(n) run-time is for any operation. Instead you just have to "trust" that it'll be fast enough.

More on this: https://www.reddit.com/r/haskell/comments/1f48dc/what_does_t...

All of the answers seem insufficient. Basically you can't estimate Haskell run-time unless you are very familiar with the internal Haskell engine.

3 comments

Completely untrue. I'm not a Haskell evangelist (I appreciate it for what it is) but I thought I would at the very least point out that most of the documentation for basic data structures (i.e. Data.List[1]) not only are well-documented but have a link on the far-right side of the documentation site that directly shows you the source code and it's usually easy to tell what it's doing. Any developer should be able to grok that code and determine the run-time complexity.

[1] https://hackage.haskell.org/package/base-4.9.1.0/docs/Data-L...

I think he's talking about how it can be hard to tell what's already been evaluated and what hasn't.
I'm not a C evangelist, but I would point out that most documentation of standard C function is very detailed and its code is shown in its man page. Any developer should be able to grok that code and determine its safety. Mattaku...
They really should be able to.
You're completely missing the point: people are not computers. They make mistakes, including while they check things. That's why you don't want to rely on tests, but rather on formal proof.
The complexity of many Haskell collection APIs is actually documented unlike with many other languages. These complexities are not changed by the runtime. Only constant factors and memory use are affected by optimisations and this is no different to any other high-level language that actually optimises code.
As a huge Haskell proponent: this is a totally legitimate question, sorry you're being downvoted.

Writing extremely performant Haskell is a very specialized skill. Happily, Haskell is still extremely fast even without fine optimizations.

It depends on what you want to do: if you're writing a moon lander and don't know anything about GHC internals you may be overreaching yourself=) But for most things like web apps etc. knowing the basics is enough.