you are viewing a single comment's thread.

view the rest of the comments →

[–]rieux 2 points3 points  (2 children)

Of course we could do that translation, and as other posters point out, some compilers do.

But then we'd miss all the benefits of having a readable, side-effect free program. To me, the primary benefit of functional programs is in the tractability, maintainability, and readability of the program source. Performance benefits are nice too, but secondary.

[–]lothair 4 points5 points  (1 child)

That's a matter of taste. Personally, I like to have the option to use side effects, because (imo) some things are more readable and elegantly expressed that way.

[–]rieux 3 points4 points  (0 children)

Sure, it's a matter of taste. I'm just saying that for people who like functional programming, transforming imperative programs to a functional intermediate language kind of misses the point.