I heard the binary compiled from typed functional languages runs faster than otherwise. Is it true?
If so, why is that? Normally, do typed languages produce faster binaries?
A statically-typed language can produce tighter, faster code because it does not have to do type lookups at every operation. This is true regardless of whether the language is functional, procedural, object-oriented, or imperative.
In general, the reason typed languages perform better is because you know everything about the types at compile time, which lets the compiler make certain optimizations based on assumptions about type.
so, in general ... yes, it would be faster ... but of course there's always caveats when perf is concerned :-)
精彩评论