Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'syntax': 0.04; 'subject:Python': 0.06; 'expressions': 0.07; 'plenty': 0.07; 'subject:would': 0.07; 'bits': 0.09; 'latter': 0.09; 'scheme.': 0.09; 'statements': 0.09; 'subset': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'jan': 0.12; 'assume': 0.14; '(implemented': 0.16; 'behaviour.': 0.16; 'expressions,': 0.16; 'guru': 0.16; 'lexical': 0.16; 'lisp': 0.16; 'scope,': 0.16; 'scope.': 0.16; 'semantics': 0.16; 'subject: \n ': 0.16; 'wrote:': 0.18; 'implementing': 0.19; 'thu,': 0.19; 'python?': 0.22; 'cc:addr:python.org': 0.22; "aren't": 0.24; 'java': 0.24; 'looks': 0.24; 'question': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'least': 0.26; 'subject:/': 0.26; 'code:': 0.26; 'header:In-Reply-To:1': 0.27; 'wondering': 0.29; 'chris': 0.29; "doesn't": 0.30; 'primarily': 0.30; 'said,': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'usually': 0.31; 'are.': 0.31; 'clever': 0.31; 'directly,': 0.31; 'languages': 0.32; 'maybe': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'c++': 0.36; 'scheme': 0.36; 'useful': 0.36; 'subject:?': 0.36; 'similar': 0.36; 'two': 0.37; 'easily': 0.37; 'implement': 0.38; 'mine': 0.38; 'pm,': 0.38; 'heard': 0.39; 'itself': 0.39; 'enough': 0.39; 'university': 0.39; 'how': 0.40; 'skip:u 10': 0.60; 'easy': 0.60; 'most': 0.60; 'first': 0.61; 'back': 0.62; 'show': 0.63; 'skip:n 10': 0.64; 'him,': 0.64; 'different': 0.65; 'to:addr:gmail.com': 0.65; 'close': 0.67; 'actually,': 0.84; 'subject: *': 0.84; 'unifying': 0.84; 'reasons,': 0.91; 'differences': 0.93 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:to :cc:content-type; bh=gtHMS/MqasiAYdjtcSZfXpSTnWDq7ePLEeLvKpCBHO8=; b=OO7NuXTB2UwcN+VczxReEdQqo5f+iH/c8LG+hGqCl7eJ1jINDrPO3vzOrkRRIgXKoH bJcE44uo2FaoYV7/BCBfcyzChgaYyFlUSo9Hz7DsJPzGeKoewYINr+47Dmh1XZVHPooL 9ni7avtyhaa41yqKgJrf466iSQu4/o96qOp9d4MGeXA/wMCUhsOu/MAA8Rmftq6VwLo3 kKMNFU39HveVGThy/FSSrcezrCDSxMV4pLb77bgaVA3/O3Oesnc9A8SesmLLUHtYp+tl v8blBaUcVLUoIzwqCCyxNEmFWLtjgMZIUENzhazJuOypDcA412XASYHEkauUH8/3T/b6 pbqA== X-Received: by 10.49.72.193 with SMTP id f1mr155670492qev.58.1388769047380; Fri, 03 Jan 2014 09:10:47 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: From: Devin Jeanpierre Date: Fri, 3 Jan 2014 09:10:07 -0800 Subject: Re: Is Python really "Lisp without parentheses"? So would it be easy to *implement* a lot of Python in Scheme/Lisp? To: Chris Seberino Content-Type: text/plain; charset=UTF-8 Cc: "comp.lang.python" 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: 1388769050 news.xs4all.nl 2837 [2001:888:2000:d::a6]:48545 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:63073 On Thu, Jan 2, 2014 at 10:46 PM, Chris Seberino wrote: > I've heard it said, by no less a guru than Peter Norvig, that Python is a lot like Lisp without the parentheses.... at least for the basics of Python. There are plenty of non-superficial differences. Python has lexical scope, lisps usually have dynamic scope. Python has statements and expressions, lisps have expressions and maybe only a few tiny extra restrictions. Python has dynamic dispatch everywhere, lisps have it usually almost nowhere. And the unifying thing that makes a lisp a lisp is macros, which Python lacks. > For pedagogical reasons, I'm wondering if it would be easy to implement a big subset of Python in Scheme. A lecturer of mine back in university did this (implemented a subset of Python in Racket). My understanding is that this is primarily interesting to show that Racket is not as crazily different as it looks from the syntax. When I TA'd for him, he had a really neat lecture where he gave the following three snippets of code: // C++ Foo x = y; x.bar = 3; // Java Foo x = y; x.bar = 3; // Scheme (define x y) (foo-bar x 3) The syntax of the first two is identical, so the uneducated would assume they do the same thing. But actually, the latter two are the ones with the identical behaviour. It is definitely true that the syntax differences hide how similar Scheme and Python are. These two languages are close enough together that any > The basics of Scheme or Lisp are amazingly easy to implement. Would implementing a subset of Python in a Scheme subset be a clever way to easily implement a lot of Python? If it's easy to implement in terms of Scheme, which is itself easy to implement, then it would be easy to implement directly, so this doesn't seem like a useful question to ask. Anyway, most of the useful bits of Python aren't present or have different semantics than how they work in lisps. -- Devin