4 ms·
Performance shouldn't be an issue if you have a decent optimizing compiler and even in JavaScript I would think a decent runtime should JIT away the overhead.
by mattnewport 9y ago
Performance shouldn't be an issue if you have a decent optimizing compiler and even in JavaScript I would think a decent runtime should JIT away the overhead.
Tangent but this is one reason C++ works nicely with a more functional style with lambdas - the compilers are pretty good about optimizing away any overhead resulting from function composition etc.
- fiatjaf 9y agoGo argue with Haskell benchmarks. Functional programming is slow.
- mattnewport 9y agoHaskell is not slow because of point free style. C++ generally won't suffer any performance penalty for point free style in an optimized build. If you think you have specific examples otherwise I'm happy to discuss them.
- lmm 9y agoHuh? Haskell does very well in the shootout, better than JavaScript and often comparable with C.
- mrkgnao 9y agoI won't comment on Haskell's speed here, but function composition can't possibly be making Haskell less faster. The reason is simple: the compiler inlines the composition operator in the vast majority of (probably all?) cases, since the Haskell standard library source code marks it with an INLINE pragma: -- | Function composition. {-# INLINE (.) #-} (.) :: (b -> c) -> (a -> b) -> a -> c (.) f g = \x -> f (g x) http://hackage.haskell.org/package/base-4.10.0.0/docs/src/GHC.Base.html# http://hackage.haskell.org/package/base-4.10.0.0/docs/src/GH....
- KirinDave 9y agoWhat? Haskell's competitive with everything but hand-tuned C code, consistently. In a world where Python and Javascript are credible languages to orchestrate numeric computing, it seems ludicrous to imply that Haskell, which has superior code generation to these options in nearly every particular, is somehow "too slow."
- fiatjaf 9y agoP.S.: I love Haskell too.