Question Details

No question body available.

Tags

functional-programming computer-science

Answers (3)

April 27, 2026 Score: 0 Rep: 1 Quality: Low Completeness: 20%

I believe functional languages gives compilers more semantic guarantees like purity and immutability which helps in optimization but c++ and rust gives the programmer more control over representation that is the memory layout allocation and data lifetimes. On modern hardware those low level details matters alot than the high level guarantees A functional compiler maybe able to optimize abstractions away but it has to prove it. C like code often starts closer to the machine the cpu wants so functional languages can optimize well but they usually rely more on compiler while rust/c let engineers directly shape the performance.

April 27, 2026 Score: 0 Rep: 312,093 Quality: Low Completeness: 0%

The problem is that all the constraints which give the compiler extra guarantees don't necessarily lead to more feasible programs. You have to do extra steps to sidestep the restrictions.

April 27, 2026 Score: 0 Rep: 5,877 Quality: Low Completeness: 20%

For complex programs written in functional language achieving the same or better performance compared to similar programs written in C/C++ by very performance obsessed programmers, the functional language compiler itself must be able to match the skill of the aforementioned programmers.

That is not yet the case.

Optimizing a specific program for a specific use case in C/C++ is still far (relatively speaking) easier than writing a general-purpose compiler that have all of those accumulated knowledge and the ability to recognize the opportunity.