5 ms·
Python language creator Guido von Rossum prevents CPython from having tail call optimization because he doesn't want people to use it. http://neopythonic.blogs
by michaelhoffman 14y ago
Python language creator Guido von Rossum prevents CPython from having tail call optimization because he doesn't want people to use it.
http://neopythonic.blogspot.com/2009/04/tail-recursion-elimination.html http://neopythonic.blogspot.com/2009/04/tail-recursion-elimi...
- sigzero 14y agoHis choice, he is the BDFL after all.
- yfyf 14y agoI wonder if he would claim the same argument today as he does in this[1] comment, in particular the paragraph "On side effects being bad <..>". I would dare to claim that there's some trend to do things more side-effectlessly not only in programming, but also in general, people in IT are finally realizing* that the more isolated, light-weight and modular things are (think of increased interest in functional programming (pure functions), dominance of cloud-based/inspired solutions (spinning up small instances of VMs)) the better. Somehow this particular mindset helps at all levels. Hah, there's actually a term for what I'm trying to describe: Shared nothing architecture[2]. Allowing side-effects on any level implies "sharing" to me. [*]: of course you could say "this has always been the case", but somehow some years ago Java and the friends seemed like the only "enterprise level" solution to most businesses and the general fat-stack+vertical-scaling seemed somewhat reasonable. [1]: http://neopythonic.blogspot.nl/2009/04/tail-recursion-elimination.html?showComment=1240451280000#c1726520516547497765 http://neopythonic.blogspot.nl/2009/04/tail-recursion-elimin... [2]: http://en.wikipedia.org/wiki/Shared_nothing_architecture http://en.wikipedia.org/wiki/Shared_nothing_architecture
- mahmud 14y agoI don't think the world of software development changed at all since 2009. It takes about 15 years to see noticable shifts in practices. Also, shared-nothing "architecture" goes back to the 60s with the first investigations into concurrency. In fact, if I were being pedantic, I would say it predates computing itself: logic is all side-effect free.
- yfyf 14y agoSure, theoretical investigations on things begin many years earlier than anyone starts actually using them, but somehow "concurrency" wasn't something available to your everyday Joe back in 60s, right? Multi-core wasn't the norm, there was no elastic cloud, what so on. And I am not really claiming that software development changed much in 3 years, but I think people's mindsets are changing faster than that, especially of those who are actively involved in thinking about these things.
- mahmud 14y agoFair point.
- lolcraft 14y agoWell, to be trollish :), he also didn't want it because: 1 - With TCO, there would be no more "recursiveFunction recursiveFunction recursiveFunction" x 1000 stack traces. Which apparently is bad. Might force someone to use a debugger, you know. 2 - Non-standard Python implementers won't be competent enough to code it, so it's best he doesn't force them to. 3 - He doesn't believe in recursion. He doesn't like it. I mean, the look of it. It's too nerdy. 4 - He made a bad choice in basing his language in dynamic binding. He recognises it, says it's horrible style, un-pythonic, but won't make it go away because users, users, yadda yadda. All this from someone whose job description is BDFL ;) Yeah, I'm bitter about some minor quirk no one cares about, but... you know, I might have preferred a "I can't be arsed to do it" answer. Those arguments are pretty laughable.
- xnxn 14y agoI clicked that link ready to laugh, but he makes a persuasive argument. I feel like I've been tricked.