4 ms·
Functional code can do better fusion, inference and unrolling than imperative code.
by nerpderp83 9y ago
Functional code can do better fusion, inference and unrolling than imperative code.
- 0xbear 9y agoCitation needed. Not saying it's not true, just haven't seen it in practice. Usually if you want efficiency, you have to drop down to intrinsics or assembly, no matter how much the compiler is helping you.
- juliangamble 9y agoLook at the publications here http://benl.ouroborus.net/ http://benl.ouroborus.net/ Also look at the Disciplined Disciple Language (related to Haskell).
- nerpderp83 9y agoThanks for the links!
- banachtarski 9y agoIt's not a question of whether it "can" or not sometimes. Say there's a performance issue in your code. In my experience, I have a much easier time figuring out where the bottleneck is just by inspection with imperative code than with functional code (especially when concurrency is involved). Sometimes, transparency is more important than raw output.