Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'syntax': 0.04; '(even': 0.05; 'output': 0.05; 'subject:Python': 0.06; 'compiler': 0.07; 'front-end': 0.07; 'parser': 0.07; 'defines': 0.09; 'executable': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'language,': 0.12; '"an': 0.16; '::=': 0.16; 'above?': 0.16; 'cc:name:python list': 0.16; 'code?': 0.16; 'janssen': 0.16; 'language:': 0.16; 'mark,': 0.16; 'or)': 0.16; 'program?': 0.16; 'quoted': 0.16; 'relates': 0.16; 'to:addr:pearwood.info': 0.16; "to:name:steven d'aprano": 0.16; 'language': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; '(not': 0.18; 'app': 0.19; 'machine': 0.22; '>>>': 0.22; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'certainly': 0.24; 'specifies': 0.24; 'stephen': 0.24; 'cc:2**0': 0.24; 'compiled': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; "doesn't": 0.30; "i'm": 0.30; 'work.': 0.31; '(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; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'science,': 0.36; 'expressed': 0.37; 'anything': 0.39; 'does': 0.39; 'how': 0.40; 'even': 0.60; 'read': 0.60; 'dave': 0.60; 'simple': 0.61; 'interest': 0.64; 'love': 0.65; 'to:2**2': 0.65; 'to:addr:gmail.com': 0.65; 'here': 0.66; 'other.': 0.75; 'exclusive': 0.81; 'inclusive': 0.84; 'programs:': 0.84; 'relate': 0.84; 'this...': 0.84; 'washington.': 0.84; 'angel': 0.91; 'taught': 0.96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=OLG6F9orrrwfcr7ONt4Pn+hm2Pyo6jdrO1TpiDGahxU=; b=d9oqeFakdAu7WHlIn613B5s98n+UFKi4jYG9G08E7EvRvb2VoZ9BBqwtX02rz/DGwC 61AePlYks63nOtXY4gxT/Y9g7A6sYw/8hxjVbnz4AaHvys7TeKyJjEq1qNNzdk9SVI+n hwvwux0Ayn7kWdwiAN8cFW8q6+yAxxoyf7Wv91AkoDWnIzF6Z3Oi6hyKfARST8ObZ88O senMBiMpS9seADVbz+kEMo8VEtVEaOJk9diPQB49jmyWyLqppNR8xWBXoozuHGpPMlla bu0EkMjRYI0w6HU4vg9FhkdnJtKzWN80NQWSZsLlsf5PRBdwfrIs1XprImkrKBqx8ape daVw== X-Received: by 10.229.110.8 with SMTP id l8mr3183523qcp.24.1382456773206; Tue, 22 Oct 2013 08:46:13 -0700 (PDT) Sender: Ned Batchelder Date: Tue, 22 Oct 2013 11:46:11 -0400 From: Ned Batchelder User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Mark Janssen , Dave Angel , Steven D'Aprano Subject: Re: Python Front-end to GCC References: <4012031f-5334-4be8-a673-e0d8c8917fb2@googlegroups.com> <5a4e0ec9-c977-4a86-83b0-9f4c55a82e37@googlegroups.com> <54f8eb09-7a2e-4306-86f2-7ae118fa8055@googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Python List 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: 60 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1382456782 news.xs4all.nl 15903 [2001:888:2000:d::a6]:35748 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57267 On 10/22/13 11: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. Mark, you had expressed interest in "an app that will take a language specification in BNF (complete with keywords and all) and output C code which is then compiled to an executable". I'm interested in how that app might work. Here's a BNF for a (very!) simple language: ::= ::= "*!?" | "--+" | "..:" That means these are three valid programs: 123 *!? 456 2 --+ 2 1001 ..: 4 What will the app output as C code for each of these? > > 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". Could you please be less snarky? We're trying to communicate here, and it is not at all clear yet who is confused and who is not. If you are interested in discussing technical topics, then discuss them. --Ned. > > Mark Janssen > Tacoma, Washington.