3 ms·
The overhead of abstraction...unless you're using Haskell where typeclass instances get specialized, so you can abstract without slowing things down.
by coolsunglasses 12y ago
The overhead of abstraction...unless you're using Haskell where typeclass instances get specialized, so you can abstract without slowing things down.
- haberman 12y agoThe article is not suggesting that abstraction inherently has overhead in all languages. Rather it is exploring the difference between languages where abstractions can be essentially free (in terms of runtime overhead), and languages/implementations where abstraction has a noticeable cost.
- tome 12y agoLet's not overstate the case. There's still plenty of abstraction which is tricky or impossible for GHC to optimize. But yes, with static analysis comes the possibility of nice optimizations.
- coolsunglasses 12y agoIndeed. I like the tricky one they're kicking around that would make `lens` faster. Pretty intriguing. I'm hopeful they'll be able to make it work in STG.