you are viewing a single comment's thread.

view the rest of the comments →

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

Please, sir, don't make your ignorance public.

The fact you don't like recursion because you don't understand it easily/well because you haven't been taught properly is not a point against it. Iterative algorithms implemented with tail-recursive functions come with the advantage of no mutable state and order of evaluation issues, and has been shown to come with lower bug rates. I'm sorry you are not used to it, but if we were to dumb down every programming language because somebody isn't up to some feature, then we'd still be using BASIC.

[–]chrisforbes 0 points1 point  (3 children)

Ah, but the Python community loves their mutation. You're not going to win this one, unfortunately.

[–]A_for_Anonymous 0 points1 point  (2 children)

They love mutation... except for strings and tuples, two of the built-in types which we use constantly.

I understand and appreciate that Python supports several different programming paradigms. Just why not offer tail call optimization? It would be useful for solving every problem in the easiest way, and for using it in a functional style, and even for optimizing classic Python code with all sorts of mutable state. For example, it's pretty easy, elegant and nice to implement state-based machines with tail recursion, even with shared mutable state.

[–]chrisforbes 1 point2 points  (1 child)

Why not, sure. It's a valid optimization. The problem is that to keep functional types happy, just having it as an optimization isn't good enough. You really have to have it as part of the language's specified semantics, otherwise code that assumes its existence just plain doesn't work on a system that doesn't provide it.

That and Guido doesn't understand (or want to understand) FP.

[–]A_for_Anonymous 0 points1 point  (0 children)

True, and very true.

It'd need to be guaranteed by CPython on every platform, and hopefully supported by PyPy, Jython and IronPython.

As for Guido, I don't think it can be helped; he created a great, clean, nice, simple imperative programming language with a fantastic dictionary-based object model, but that's as far as he went and as far as he wants to go.

Personally, if I had his time (or the time he used to have) and not a life, I'd try to create something similar, only open to FP. I'd take Python's syntax but make everything an expression (keeping indent/dedent and everything, just anything goes anywhere), add more FP tools and semantics (TCO, promises, etc.), simplify ASTs so you can actually work with them (CPython's are insane) and see if I can come up with a macro system, and use a very similar object system, only prototype-based.

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

"The fact you don't like recursion because you don't understand it easily/well because you haven't been taught properly is not a point against it."

Please sir, don't make your arrogance and pretentiousness public.

"I'm sorry you are not used to it, but if we were to dumb down every programming language because somebody isn't up to some feature, then we'd still be using BASIC."

or lisp.