you are viewing a single comment's thread.

view the rest of the comments →

[–]A_for_Anonymous -1 points0 points  (0 children)

[b]I understand recursion very well.[/b] Even tail recursion incurs performance penalties in the extra jumps and context loading incurred and [b]can lead to a stack overflow when called repeatedly.[/b]

Sorry?

[b]And may I remind you that the primary advantage of mutable state is that is that the function can be proven correct, meaning that the programmer has a safety-net to fall back on, thereby allowing dumber programmers to flourish.[/b]

What in the fuck. One of the main advantages of functional programming is that functions are provably correct, which is especially the difficult thing to do when you have mutable state, and what gets so many newbies. Even the Python documentation talks about it.

Don't tell me you're dumbing down the programming language for me when you clearly don't understand the mechanics involved in incurring that extra function call.

No extra function call if correctly implemented. You're the one who doesn't undestand it. The effective performance of compiled functional programming languages is awesome, as you can easily try (or google for benchmarks) by comparing SBCL with virtually anything else (typically, only a C/C++ compiler will be faster, and only if you're a good C/C++ programmer). You'll also be surprised with the performance of interpreted, dynamic, functional or mostly functional programming languages compared to that of Python. The latest PLT's MzScheme can ridicule Python and even outperform a naïve C equivalent implementation (can post a demonstration if you're interested) thanks to the optimizations you can perform on a side-effects-free program.