Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Why not allow empty code blocks? Date: Wed, 3 Aug 2016 23:31:31 +1000 Lines: 31 Message-ID: References: <579B1ABB.1070500@rece.vub.ac.be> <20160731115347.3c2a8344@imp> <20160731120434.3f587ad9@imp> <9a08c631-ce14-dc04-f038-ab31bd3ec350@gmail.com> <28fa2205-5d30-4d00-9ab9-b56c66274dd5@googlegroups.com> <3d96c99b-72fa-439c-93b4-abef2b9fd8a0@googlegroups.com> <579f207f$0$11110$c3e8da3@news.astraweb.com> <01f3d086-ba00-43c6-8f86-712fb940b054@googlegroups.com> <57a0dd53$0$1620$c3e8da3$5496439d@news.astraweb.com> <87a8gv562h.fsf@jester.gateway.pace.com> <57a1b23c$0$11093$c3e8da3@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de 6J3n1GIQnuqbkbGGo3gxpg1mvS/tDKgCveLNsA/QbXeg== 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; 'python,': 0.02; 'value,': 0.03; 'subject:code': 0.07; 'cc:addr:python-list': 0.09; 'library?': 0.09; 'pointers': 0.09; 'subject:Why': 0.09; 'python': 0.10; 'python.': 0.11; 'subject:not': 0.11; 'translate': 0.15; 'wed,': 0.15; '.py': 0.16; '2016': 0.16; 'code?': 0.16; 'example).': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'how,': 0.16; 'jython,': 0.16; 'lisp': 0.16; 'lisp,': 0.16; 'openssl': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:allow': 0.16; 'surprising': 0.16; 'wrote:': 0.16; 'language': 0.19; 'math': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'aug': 0.20; 'java': 0.22; 'code.': 0.23; 'references': 0.23; 'import': 0.24; 'implemented': 0.24; 'header:In-Reply-To:1': 0.24; 'sort': 0.25; 'module': 0.25; "doesn't": 0.26; 'message-id:@mail.gmail.com': 0.27; 'translated': 0.27; 'host': 0.28; 'function': 0.28; 'sensible': 0.29; 'probably': 0.31; 'another': 0.32; 'implement': 0.32; "d'aprano": 0.33; 'steven': 0.33; 'received:google.com': 0.35; 'could': 0.35; 'exist': 0.35; 'files,': 0.35; 'sometimes': 0.35; 'but': 0.36; 'modules': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'support,': 0.37; 'seem': 0.37; 'things': 0.38; 'some': 0.40; 'provide': 0.61; 'real': 0.62; 'relatively': 0.63; 'more': 0.63; 'risk': 0.68; 'yourself': 0.73; 'anywhere.': 0.84; 'attacks.': 0.84; 'chrisa': 0.84; 'etc),': 0.84; 'ultimately,': 0.84; 'to:none': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc; bh=kGVzXyOOk5MY/g7mFZbtIYHJTexcSwhIwSvHqWRFjME=; b=jAMR2UI1Z/HNrUkzOhpvm5i3sT5AEEIrFp20m7W348WkxHkIMJNJvI5hIoog6BRYtg +T8nMVzivB4AA2WxMb9bIWKQ+lzga4V+13LV/L3vTsXtlgMs3qGhgIOnQuDdSFLkFLQ7 ie6FjoTLQPBYAfUlCj9P7kTy8EfINSg0sJn5ZHrR37FvJVY17OkRVToFdT/CI0ROsz7Y emOU8rmIjAie8NOMuEPG2qhvcCreTTt1JHoPqt/gR/3oF3dde/KIRybxQoqUTLLTXzVE efqlzEBGb7alKdi532ZBfNgCowUQzP77X3c/cw4VtloCFra5YwEt2N1bDF5C96EIg/NF ST1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc; bh=kGVzXyOOk5MY/g7mFZbtIYHJTexcSwhIwSvHqWRFjME=; b=XZ/AxBQIr0/3nS3hHR6jeXnBZlvizpRVkSkiiaAXBqPYbvoMAVvrBp787FCwwxUU99 p9QGIo6bTCJf97PjOEDqxPYsiyYt238nMSCpf8I1zsELBEAf9cCQmex78VvlNYdkyBua As3iluIgy8/AZYFF/YqBfiZLLdRKjgZVm0/K54cUY3Rb7cODu1ioX47LXq5KTK7qOTze I3I0anFYcPEGUMZgwfm/gwQoLZBXMSaF7lLm0Ytgx0pfmtYzLYiFB5GpvesYOIEXoHNS n1JFH3Iu3z+L2+k9u9Ob4HagUVMouP7sHgxIf0K0Kwie0v5v7tVdhVJHseQfJuBNccFF +OuQ== X-Gm-Message-State: AEkoouv8xJDCEqp9Hg9/V/z/Tkt6YaDi3+vGtFt54WLSDFOamoZEyN9+3PrsyuSyv9Ev7CGoWpZHexjVK6FFvA== X-Received: by 10.28.45.69 with SMTP id t66mr25154421wmt.41.1470231091757; Wed, 03 Aug 2016 06:31:31 -0700 (PDT) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <579B1ABB.1070500@rece.vub.ac.be> <20160731115347.3c2a8344@imp> <20160731120434.3f587ad9@imp> <9a08c631-ce14-dc04-f038-ab31bd3ec350@gmail.com> <28fa2205-5d30-4d00-9ab9-b56c66274dd5@googlegroups.com> <3d96c99b-72fa-439c-93b4-abef2b9fd8a0@googlegroups.com> <579f207f$0$11110$c3e8da3@news.astraweb.com> <01f3d086-ba00-43c6-8f86-712fb940b054@googlegroups.com> <57a0dd53$0$1620$c3e8da3$5496439d@news.astraweb.com> <87a8gv562h.fsf@jester.gateway.pace.com> <57a1b23c$0$11093$c3e8da3@news.astraweb.com> Xref: csiph.com comp.lang.python:112289 On Wed, Aug 3, 2016 at 11:23 PM, BartC wrote: > On 03/08/2016 09:58, Steven D'Aprano wrote: > >> Python is sometimes described as a Lisp with more sensible syntax, so its >> not >> surprising that it is relatively simple to translate Python to Lisp and >> visa >> versa. > > > Translating Python would be easier if everything was implemented as Python. > But sometimes you try to find a .py import module and it doesn't seem to > exist anywhere. (sys.py for example). > > I would like to see how such references are translated to Lisp. Ultimately, you _cannot_ implement everything in Python, unless you create some sort of crazy fudge like having function pointers with real language support, in which case you're writing C code. Some modules have to be implemented in the host language (C for CPython, Java for Jython, etc), in order to provide lower-level functionality. You probably *could* implement the whole math module in pure Python, but you don't want to; and cryptography, likewise, you theoretically could implement in pure Python, and you'd get the same return value, but you risk opening yourself up to timing-based attacks. How, from Lisp, would you call on OpenSSL or another lower-level library? Or do you have to reimplement everything? What about simple things like opening files, how do you do that without native code? ChrisA