Skip to content

Comment on Okapi – A micro web framework for Haskellparent

Comments

I’ve done quite a few small to medium sized projects in Haskell, both personal and commercial, and worked on one larger system at an investment bank. It’s really easy to avoid those issues with modern Haskell, just following some rules of thumb (e.g. annotate all your datatype members with ! to make them strict) and avoiding some well known pitfalls.

I saw someone complaining about a memory leak the other day on reddit, and it boiled down to someone using annotations to control inlining and insisting that it ought to work. If you’re not flying close to the sun, you’re unlikely to have serious trouble.

I wrote a really nice system with Servant recently which does stream processing and serving of large files using the ‘streaming’ library (https://hackage.haskell.org/package/streaming). In its initial versions, my app wasn’t very snappy with large files, but I didn’t think much of it - it seemed acceptable. But while I was cleaning up the code I made a small change that improved its performance by an order of magnitude. I’d have to go check what it was now, but the gist of it was using these really high level abstractions in a suboptimal way. I don’t think that’s an issue with Haskell itself, so much as the tradeoffs involved in using powerful abstractions you don’t fully understand. I was super pleased with the end result though.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.