开发者

Are typed functional languages faster?

开发者_运维百科

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 :-)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜