Path: csiph.com!usenet.pasdenom.info!news.albasani.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'syntax': 0.04; 'subject:Python': 0.06; 'compiler': 0.07; 'front-end': 0.07; 'parser': 0.07; 'defines': 0.09; 'executable': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'language,': 0.12; 'above?': 0.16; 'code?': 0.16; 'compiler.': 0.16; 'janssen': 0.16; 'program?': 0.16; 'quoted': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'language': 0.16; 'wrote:': 0.18; 'community,': 0.19; 'written': 0.21; 'machine': 0.22; 'header:User-Agent:1': 0.23; 'certainly': 0.24; 'specify': 0.24; 'defined': 0.27; 'header:X-Complaints- To:1': 0.27; "doesn't": 0.30; 'included': 0.31; 'code': 0.31; 'subject:end': 0.31; 'anyone': 0.31; 'actual': 0.34; 'could': 0.34; 'but': 0.35; 'charset:us-ascii': 0.36; 'received:99': 0.38; 'to:addr:python-list': 0.38; 'anything': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'even': 0.60; 'read': 0.60; 'more': 0.64; 'fortunately': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dave Angel Subject: Re: Python Front-end to GCC Date: Tue, 22 Oct 2013 04:39:21 +0000 (UTC) References: <4012031f-5334-4be8-a673-e0d8c8917fb2@googlegroups.com> <5a4e0ec9-c977-4a86-83b0-9f4c55a82e37@googlegroups.com> <54f8eb09-7a2e-4306-86f2-7ae118fa8055@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 99-43-76-189.lightspeed.hstntx.sbcglobal.net User-Agent: XPN/1.2.6 (Street Spirit ; Linux) 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1382416785 news.xs4all.nl 15938 [2001:888:2000:d::a6]:60523 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57234 On 22/10/2013 00:24, Mark Janssen wrote: >> 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. > Did you even read the paragraph you quoted above? The BNF specification does NOT completely describe a language, it only defines its syntax. So if the only thing you knew about C was its BNF, you could certainly not write a C compiler. And neither could anyone else. Fortunately for the C community, the language specification included much more than a BNF grammar. At a minimum, you have to specify both the syntax and the semantics. All that has nothing to do with an actual program written in an actually defined language, whether C or Python. -- DaveA