Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'syntax': 0.04; '(even': 0.05; 'subject:Python': 0.06; 'compiler': 0.07; 'front-end': 0.07; 'parser': 0.07; '22,': 0.09; 'defines': 0.09; 'english,': 0.09; 'executable': 0.09; 'python': 0.11; 'language,': 0.12; 'language.': 0.14; 'above?': 0.16; 'code?': 0.16; 'janssen': 0.16; 'or)': 0.16; 'program?': 0.16; 'quoted': 0.16; 'relates': 0.16; 'semantics': 0.16; 'elements': 0.16; 'language': 0.16; 'wrote:': 0.18; '(not': 0.18; 'written': 0.21; 'machine': 0.22; '>>>': 0.22; 'rules': 0.22; 'to:name:python-list@python.org': 0.22; 'certainly': 0.24; 'specifies': 0.24; 'stephen': 0.24; 'header:In- Reply-To:1': 0.27; 'am,': 0.29; 'words': 0.29; "doesn't": 0.30; 'said,': 0.30; 'message-id:@mail.gmail.com': 0.30; '(which': 0.31; 'code': 0.31; '>>>>': 0.31; 'claiming': 0.31; "d'aprano": 0.31; 'keywords,': 0.31; 'steven': 0.31; 'subject:end': 0.31; 'received:74.125.82': 0.34; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'described': 0.36; 'science,': 0.36; 'to:addr:python-list': 0.38; 'anything': 0.39; 'received:74.125': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'even': 0.60; 'read': 0.60; 'dave': 0.60; 'such': 0.63; 'love': 0.65; 'here': 0.66; 'other.': 0.75; 'exclusive': 0.81; 'inclusive': 0.84; 'relate': 0.84; 'this...': 0.84; 'words)': 0.84; 'angel': 0.91; 'taught': 0.96; '2013': 0.98 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:to:content-type; bh=ffU61zKRDIDmVjbh9cLLLBjnUpLAC/hf2iu22c4LtDI=; b=HkKwL/MpdaEcIe1FREYwZ22+sxUeIXUFuP0314kFfFib6+Soqj8PVaPb1cqsBQJAg+ w8v4Do6xnAwtHyPikEbHlAZcFL90Qok6B99ULTWCBHUcnQOLsG8R1zCm4FMeAsrAOZN5 fi3kdqKrGZnIMf4nZ4Gg3z0WcSoLwL3dJLLkkFRknkEvGLqayzvXcjObjlaA3CABT4G0 KzRFmGF1cgo+zGZjFBJWx2RXdAZ8CZGMmx27rPNl6J8MXAc/8KUOAisPwZ/rTUt3Vcmo TsQaEzH69ihRzm5WmSTiWGFx206cBKZcJQ7HZmclpEClx2En1C9M4Uwl4U+XPJGoKL3q T3sg== X-Gm-Message-State: ALoCoQkew9Er+quU2Mn/t3HYIEZDk49UAfVTDuQvF2NSineTfDnBfQdMP8NEZKSd6v+DrIlpun/wYYmwZDjOZFG5Dk18C+IjbDevz2xtoJvUHuYGyOHIj2iqbcBZIhkPeC1E2G+E2zZdE7nRCdEggLnkTaMniM1JkQ== X-Received: by 10.180.219.33 with SMTP id pl1mr15406060wic.49.1382457850137; Tue, 22 Oct 2013 09:04:10 -0700 (PDT) X-Received: by 10.180.219.33 with SMTP id pl1mr15406047wic.49.1382457849990; Tue, 22 Oct 2013 09:04:09 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <4012031f-5334-4be8-a673-e0d8c8917fb2@googlegroups.com> <5a4e0ec9-c977-4a86-83b0-9f4c55a82e37@googlegroups.com> <54f8eb09-7a2e-4306-86f2-7ae118fa8055@googlegroups.com> From: Benjamin Kaplan Date: Tue, 22 Oct 2013 09:03:49 -0700 Subject: Re: Python Front-end to GCC To: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-Junkmail-Whitelist: YES (by domain whitelist at mpv1.tis.cwru.edu) 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: 43 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1382458235 news.xs4all.nl 15991 [2001:888:2000:d::a6]:50528 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57271 On Tue, Oct 22, 2013 at 8:04 AM, Mark Janssen wrote: > I love it. Watch this... > > [context] >>>> A language specification in BNF is just syntax. It doesn't say anything >>>> about semantics. So how could this be used to produce executable C code >>>> for a program? BNF is used to produce parsers. But a parser isn't >>>> sufficient. >>> >>> A C program is just syntax also. How does the compiler generate >>> executable machine code? Extrapolate into a Python front-end to C. > > [Dave Angel responds:] >> Did you even read the paragraph you quoted above? The BNF specification >> does NOT completely describe a language, it only defines its syntax. > > [Steven D'Aprano responds:] >> Like every other language, C programs are certainly not *just* syntax. >> Here is some syntax: >> >> &foo bar^ := > > Now, I don't know where y'all were taught Computer Science, but BNF > specifies not only syntax (which would be the *tokens* of a language), > but also its *grammar*; how syntax relates to linguistic categories > like keywords, and tokens relate to each other. > > Dave is claiming that BNF only defines the syntax of a language, but > then Stephen goes on to supply some syntax that a BNF specification of > the language would not allow (even though Steven calls it "syntax" > which is what BNF in Dave's claim parses). > > So which of you is confused? I ask that in the inclusive (not > exclusive OR) sense.... ;^) <-- face says "both". > I don't know where you were taught English, but syntax is " the way in which linguistic elements (as words) are put together to form constituents (as phrases or clauses) ", not the set of valid words (tokens) in a language. A grammar, such as those grammars written in BNF, describe the rules for the syntax of a language. And, as Steven said, it still doesn't describe the semantics of a language, which is the set of instructions described by the syntax.