Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ben Finney Newsgroups: comp.lang.python Subject: Re: Question about math.pi is mutable Date: Tue, 10 Nov 2015 23:14:19 +1100 Lines: 50 Message-ID: References: <87ziyowy83.fsf@elektro.pacujo.net> <8537wghwjb.fsf@benfinney.id.au> <85y4e8ggrj.fsf@benfinney.id.au> <85twowgfm6.fsf@benfinney.id.au> <564081e7$0$1592$c3e8da3$5496439d@news.astraweb.com> <56415873$0$1614$c3e8da3$5496439d@news.astraweb.com> <854mgufkqm.fsf@benfinney.id.au> <201511101033.tAAAXYZP001340@fido.openend.se> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de aAeWO0cr/w/oUraP0tv1Mg5rjbXfq8R5+kSgDUL2XRAQ== Cancel-Lock: sha1:8GOv+hQfp+4T9iFcCEQJRwyEHfQ= Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'compiler': 0.05; 'cpython': 0.05; 'run-time': 0.05; 'subject:Question': 0.05; 'statically': 0.07; 'compiler.': 0.09; 'compilers.': 0.09; 'creighton': 0.09; 'imported.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'runtime': 0.09; 'python': 0.10; 'explicitly': 0.15; 'interpreter': 0.15; 'compiler,': 0.16; 'distinct': 0.16; 'objection': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'run.': 0.16; 'runtime.': 0.16; 'later': 0.16; 'compilation': 0.18; 'laura': 0.18; 'module,': 0.18; 'refers': 0.18; '2015': 0.20; 'proposed': 0.20; 'level,': 0.22; 'strict': 0.22; 'seems': 0.23; 'import': 0.24; 'module': 0.25; 'header:User-Agent:1': 0.26; "doesn't": 0.26; 'header:X -Complaints-To:1': 0.26; "i'm": 0.30; 'code': 0.30; 'compiled': 0.32; 'run': 0.33; "d'aprano": 0.33; 'steven': 0.33; 'though.': 0.33; 'definition': 0.34; 'tue,': 0.34; 'could': 0.35; 'done': 0.35; 'i.e.': 0.35; 'nov': 0.35; 'something': 0.35; "isn't": 0.35; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'things': 0.38; 'anything': 0.38; 'sure': 0.39; 'well.': 0.40; 'to:addr:python.org': 0.40; 'no.': 0.62; 'more.': 0.63; 'skip:\xe2 10': 0.70; '8bit%:43': 0.72; '_o__)': 0.84; 'brain,': 0.84; 'compiles': 0.84; 'conditions,': 0.84; 'received:125': 0.84 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: jigong.madmonks.org X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) 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: , Xref: csiph.com comp.lang.python:98591 Laura Creighton writes: > In a message of Tue, 10 Nov 2015 17:10:09 +1100, Ben Finney writes: > >I am a Bear of Little Brain, but: Isn't anything that the *compiler* > >does, by definition done at *compile* time? > > No. > > We used to have a pretty strict defintion about what a compiler was, > and what an interpreter was. You did the compile things at compile > time, and then you the the interpreter things at runtime. > > No more. We have Just in Time compilers. They do their compiling at > run time. Or perhaps 'there is no such thing as compile time any > more'. Very well. I argued on the basis of what could be determined at the time Steven refers to as “compile time”, i.e. before any part of the module begins to run. Steven D'Aprano writes: > Python -- yes, even CPython -- has a runtime compiler. When you import > a module, it is compiled (if needed) just before the import. Likewise, > when you call the `compile`, `eval` or `exec` built-ins, the compiler > operates. > > I'm not calling this a JIT compiler, because the simple-minded > compilation performed by `compile` etc doesn't use any run-time > information. It just statically compiles the code to byte-code. That's what I though. I'm aware of JIT compilers, and was pretty sure Python doesn't have them. What's more, if it operates at a whole-module level, and not later than when the module is imported. Under those conditions, I maintain my objection to the proposed optimisation. The proposal is explicitly for optimisations made by the Python compiler. As proposed, it only seems to be worthwhile once Python no longer has a distinct “compiler” and “interpreter” is dissolved. Until then, it seems pointless. -- \ “There is something wonderful in seeing a wrong-headed majority | `\ assailed by truth.” —John Kenneth Galbraith, 1989-07-28 | _o__) | Ben Finney