Comment by veltas

2 days ago

That's not what I see reported, they say Haskell tends to have bad memory layout generally and takes a 5x or so hit to performance.

Depends what you're doing, but it really can have C-comparable speed. [0]

Unoptimised/naive Haskell might be that slow. But that's true of a lot of languages and isn't particularly interesting to me. Java is slow if you do everything the naive way, too.

[0] https://entropicthoughts.com/on-competing-with-c-using-haske...

  • Java ain't slow even if you do really stupid stuff. Hell, I would even argue that java is the most resistant to stupid code. Some way over-abstracted everything linked data structure will be faster in java than it is in C.

    • Haskell's most badly optimised type, is the String.

      Java's most badly optimised type, is the String.

      Both of them need a string-builder pattern, the default operators don't work around things to do the right thing for you. They expect you to understand how data works.

The phrase “tends to” is doing a lot of work here. Inexperienced Haskellers tend to use the singly linked list for everything and that data structure just doesn’t perform in any language.