Path: csiph.com!usenet.pasdenom.info!news.albasani.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'languages,': 0.04; '(so': 0.07; 'skip:" 60': 0.07; 'imported': 0.09; 'interpreted': 0.09; 'output,': 0.09; 'subject: [': 0.09; 'python': 0.11; '"programming': 0.16; "'test',": 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'fuzzy': 0.16; 'janssen': 0.16; 'program?': 0.16; 'quoted': 0.16; 'reflects': 0.16; 'skip:" 70': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'import': 0.22; "shouldn't": 0.24; 'fairly': 0.24; 'header': 0.24; 'mon,': 0.24; 'versions': 0.24; 'compare': 0.26; 'compiled': 0.26; 'url:edu': 0.26; 'header :In-Reply-To:1': 0.27; '[1]': 0.29; 'am,': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; '(which': 0.31; 'code': 0.31; '-0700,': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'file': 0.32; 'quite': 0.32; 'text': 0.33; 'raw': 0.33; 'third': 0.33; 'could': 0.34; 'received:209.85': 0.35; 'received:209.85.220': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'skip:" 50': 0.36; 'should': 0.36; 'received:209': 0.37; 'being': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'called': 0.40; 'even': 0.60; 'manually': 0.60; 'matter': 0.61; 'course': 0.61; 'become': 0.64; 'series': 0.66; 'between': 0.67; 'fourth': 0.84; 'kinda.': 0.84; 'seldom': 0.84; 'subject:gets': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=nD8EA0fmUjFopErbbI3BYkXjTgIomMWpySsvIorilj8=; b=UbjwfCXJhnSMLPU7vvgK8SJGSfufy8dxt3o8Wy6R9gmccgZyjl+ZRAbnyhfGEotHyn YKsUbcqeX+BmBt6TpdwtF9l4B4r3nVaVtA8hsli6GaT8ArEAqfqe8p4QSYfNkeRrY+4s 48dVY5NEV4jRqXQtEKuqfMIw4TxV0kIa1GeaBSCiWD2P6y8rihFZ47T42F6hwShUJpts Ntxl0yUZgrBask8dTox5T0p1dWQvDtygz6NSqTHjIBzpffNg4ZyVDRDdM5DNXdMUWigi D+gruXQSJ45pFnzvT/gs6xEXM1XaURR2ltmgrkIPg+sXv6RY32pqtn5Nt2R38ifuIQgo m5Zw== MIME-Version: 1.0 X-Received: by 10.221.4.4 with SMTP id oa4mr1278169vcb.70.1371421577327; Sun, 16 Jun 2013 15:26:17 -0700 (PDT) In-Reply-To: <51be19f1$0$29966$c3e8da3$5496439d@news.astraweb.com> References: <2bc90d3b-09c2-4315-9357-ff7f039465e0@googlegroups.com> <51ba6e92$0$29997$c3e8da3$5496439d@news.astraweb.com> <51bb454c$0$29997$c3e8da3$5496439d@news.astraweb.com> <51bdaa78$0$29966$c3e8da3$5496439d@news.astraweb.com> <51be19f1$0$29966$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 17 Jun 2013 08:26:17 +1000 Subject: Re: Compiling vs interpreting [was Re: A certainl part of an if() structure never gets executed.] From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 47 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371421585 news.xs4all.nl 15887 [2001:888:2000:d::a6]:44264 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48484 On Mon, Jun 17, 2013 at 6:02 AM, Steven D'Aprano wrote: > On Sun, 16 Jun 2013 12:31:59 -0700, Mark Janssen wrote: >>> The line between compilers >>> and interpreters is quite fuzzy. >> >> It shouldn't be. > > Of course it should be, because that reflects reality. It's fuzzy AND it seldom even matters. Compare these three text strings: """'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'"""" """'a'*64""" """\37\213\b\b*8\276Q\0\3test\0KL\244\f\0\0Ue\264\211@\0\0\0""" """\x78\xda\x4b\x4c\xa4\x0c\0\0\x14\x8d\x18\x41""" Which of these is an interpreted program? I would say: All of them. And they all produce the same output, a series of 64 copies of the letter a. The third one is interpreted by gzip(1) and will create a file called 'test', the fourth is a raw gzip/zlib stream and so is interpreted by (eg) the Python zlib.decompress() function. They're all languages, of a sort. Are they interpreted/compiled versions of that message? Kinda. If you prepend a sfx header to them, do they become compiled and not interpreted? Doubtful. I don't think you could say that this ceases to be interpreted: import zlib print(zlib.decompress( """\x78\xda\x4b\x4c\xa4\x0c\0\0\x14\x8d\x18\x41""" )) Even if you manually imported the code for zlib.decompress, in a way that makes it impossible for your cut-down program to actually compress data (which then breaks the principle quoted from "Programming in Lua"), it's still fairly clearly being interpreted/parsed the exact same way. So it really doesn't matter (so it really doesn't matter (so it really doesn't matter)). [1] ChrisA [1] http://math.boisestate.edu/gas/ruddigore/web_opera/rudd24.html