Advantages of compilers for functional languages over compilers for imperative languages

Posted by Onorio Catenacci on Stack Overflow See other posts from Stack Overflow or by Onorio Catenacci
Published on 2010-02-06T00:49:59Z Indexed on 2010/05/27 16:51 UTC
Read the original article Hit count: 650

As a follow up to this question What are the advantages of built-in immutability of F# over C#?--am I correct in assuming that the F# compiler can make certain optimizations knowing that it's dealing with largely immutable code? I mean even if a developer writes "Functional C#" the compiler wouldn't know all of the immutability that the developer had tried to code in so that it couldn't make the same optimizations, right?

In general would the compiler of a functional language be able to make optimizations that would not be possible with an imperative language--even one written with as much immutability as possible?

© Stack Overflow or respective owner

Related posts about c#

Related posts about F#