Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'anyway.': 0.04; 'debug': 0.04; 'received:134': 0.05; 'semantic': 0.07; 'loop.': 0.09; 'worse': 0.09; 'anyway': 0.11; '--debug': 0.16; 'distinct': 0.16; 'received:ac.be': 0.16; 'something.': 0.16; 'wrote:': 0.16; "wouldn't": 0.16; 'version.': 0.18; '>>>': 0.20; '2015': 0.20; 'assumes': 0.22; 'disable': 0.22; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; "doesn't": 0.26; 'chris': 0.26; '14,': 0.27; 'record': 0.29; 'does,': 0.29; 'equivalent.': 0.29; 'tail': 0.29; 'program,': 0.29; 'subject:/': 0.30; 'compared': 0.30; 'received:be': 0.30; 'doubt': 0.33; 'optimize': 0.33; 'traceback': 0.33; 'tue,': 0.34; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'no,': 0.38; 'rather': 0.39; 'to:addr:python.org': 0.40; 'behavior': 0.61; 'default': 0.61; 'per': 0.62; 'lose': 0.63; 'records': 0.70; 'jul': 0.72; 'iterative': 0.84; 'loose': 0.84 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjYFAB0WpVWGuA9G/2dsb2JhbABbhCwkgyTAJgKCFQEBAQEBAYUvAQEEI1URCxgCAgUWCwICCQMCAQIBDzYTBgICiBUDErdskHINSIR8AQEIAiCBIooqgk2CQBaCUoFDAQSUMooggWaINokVhyMmY4MabYJLAQEB Date: Tue, 14 Jul 2015 16:02:10 +0200 From: Antoon Pardon User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Possibly Pythonic Tail Call Optimization (TCO/TRE) References: <55A3A853.4040006@rece.vub.ac.be> <55A3C366.6060602@rece.vub.ac.be> <87fv4r1fre.fsf@jester.gateway.sonic.net> <87bnff1eks.fsf@jester.gateway.sonic.net> <87d1zunctp.fsf@elektro.pacujo.net> <87k2u2eu67.fsf@elektro.pacujo.net> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1436882559 news.xs4all.nl 2872 [2001:888:2000:d::a6]:37019 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:93811 On 07/14/2015 03:43 PM, Chris Angelico wrote: > On Tue, Jul 14, 2015 at 11:38 PM, Marko Rauhamaa wrote: >> Chris Angelico : >> >>> On Tue, Jul 14, 2015 at 10:28 PM, Marko Rauhamaa wrote: >>>> I would rather optimize by default and disable optimizations with >>>> --debug or equivalent. >>> That assumes that it's simply an optimization. This is a distinct >>> semantic change. >> No, tail call optimization doesn't change the behavior of the program, >> for the worse anyway. > It does, because you lose traceback records. That's pretty significant > when you come to try to debug something. I doubt it would be really significant. Not compared to writing it iteratively. When you write it iteratively, you don't get to keep a traceback record per time you go throught the loop. So the traceback records you loose in tale call elimination would be the traceback records you wouldn't have anyway in the iterative version. So how would this be significant?