From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a6b:b641:: with SMTP id g62-v6mr6110021iof.103.1535384527524; Mon, 27 Aug 2018 08:42:07 -0700 (PDT) X-Received: by 2002:aca:c68d:: with SMTP id w135-v6mr303831oif.4.1535384527366; Mon, 27 Aug 2018 08:42:07 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!g24-v6no3584389iti.0!news-out.google.com!c63-v6ni4126ith.0!nntp.google.com!g24-v6no3584387iti.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 27 Aug 2018 08:42:07 -0700 (PDT) In-Reply-To: <64d7d54b-40fd-4090-b772-1402cce09dc4@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=47.185.195.62; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 47.185.195.62 References: <309225242.556906218.575482.laguest-archeia.com@nntp.aioe.org> <2145221813.556924687.162377.laguest-archeia.com@nntp.aioe.org> <3892c779-2924-405c-b88d-19389fc5ba3e@googlegroups.com> <1ceec6d8-c5c4-49b1-9808-a3580bba3f8e@googlegroups.com> <64d7d54b-40fd-4090-b772-1402cce09dc4@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Studying and Maintaining GNAT, Is There Any Interest in a New Group? From: "Dan'l Miller" Injection-Date: Mon, 27 Aug 2018 15:42:07 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:54268 Date: 2018-08-27T08:42:07-07:00 List-Id: On Monday, August 27, 2018 at 9:46:22 AM UTC-5, Lucretia wrote: > On Monday, 27 August 2018 03:38:32 UTC+1, Dan'l Miller wrote: >=20 > > > There is no quibbling, I was pointing out his error in what he though= t was what. > >=20 > > No, I was the one at the risk of quibbling by pointing out that GNAT ha= s this weird not-truly-front-end, > > not-truly-back-end 3rd layer called GIGI tree transducer to convert bet= ween the two (i.e., Ada versus > > C/C++) semantic trees, where the Ada semantic tree is in the Ada-langua= ge-source-code front-end > > and the C/C++ semantic tree is in the C-language-source-code back-end o= f GNAT. > >=20 > > My main point is: I suspect that (except for brand new revisions of th= e Ada _LRM_) most bugs are not > > in the GNAT true-=E2=80=A2front=E2=80=A2-end in Ada-language source-cod= e nor in the GNAT true-=E2=80=A2back=E2=80=A2-end in C > > language source-code shared with the rest of GCC. I suspect that the v= ast majority of lingering > > compiler bugs in GNAT have their root cause in less-than-perfect tree-t= ransduction from Ada semantic > > tree to C/C++-GENERIC/GIMPLE semantic tree, due in turn to having blind= ers on or tunnel vision, not > > looking at enough context in the large. >=20 > You don't seem to understand how compilers or GCC is structured. There is= no weird 3rd layer. >=20 > Compilers use multiple intermediate representations starting with an asbs= tract syntax tree, the passes > take in the AST and modify it or create a new tree/IR until it gets to th= e point where code generation can > take place. That's essentially it >=20 > Source Language -> Front-end -> AST -> IR -> IR -> .. -> IR -> Codegen ->= Assembly code -> Assembler -> Machine code -> Linker -> Executable And there is where you made your mistake. That is in fact the bland non-in= novative straight-from-the-textbook layering for C/C++ in GCC and many othe= r languages' compilers. Instead for GNAT the correction to your diagram looks like this: Ada source Language -> Ada front-end written in Ada -> AdaAST from raw synt= ax repeatedly repeatedly repeatedly repeatedly traversed to adorn the AdaAS= T with Ada semantic adornments -> =E2=80=A2=E2=80=A2C/C++ semantic tree=E2= =80=A2=E2=80=A2 -> IR -> IR -> =E2=80=A6 -> IR -> Codegen -> Assembly code = -> Assembler -> Machine code -> Linker -> Executable or DLL What is peculiar to GNAT is tree transduction from Ada semantics to C/C++ s= emantics. This was Dewar's & RMS's (& Schonberg's?) et. al.'s clever trick= in 1993 to make Ada compatible with GCC's pre-existing design: transduce = the Ada front-end's semantics tree into the C/C++ =E2=80=A2front=E2=80=A2-e= nd's C/C++ semantics tree (after, via repeated repeated repeated repeated t= raversals, preserving the =E2=80=A2tree=E2=80=A2 structure for representing= semantics instead of most prior Ada compilers' semantics-DAG, because tree= -to-tree transduction is difficult enough, whereas DAG-to-tree transduction= is much more impractical). As I said at the outset, the very nature of this discussion risks accusatio= ns of quibbling what is and is not so-called IR in the so-called back-end. = ('Tis funny that you discounted the existence of the risk of quibbling ove= r where the boundary between front-end & back-end precisely falls in GCC an= d then launched full-throttle right into that predicted quibbling.) Person= ally, for the GCC C/C++ compiler, I place the authoring of the C/C++ semant= ic tree in the front-end, not the back-end, because, well, C/C++ semantics = is a property of C/C++ language standardization. GNAT has a clever rear-of= -(Ada-)front-end-to-rear-of(-C/C++)-front-end transduction that is not comm= onplace in most other compilers. All of your diagram's stages are to incrementally =E2=80=A2lower=E2=80=A2 l= ayers. GNAT has=E2=80=94in addition to all that=E2=80=94a =E2=80=A2lateral= =E2=80=A2 transduction to the output of another language's (C/C++'s) =E2=80= =A2front=E2=80=A2-end. Even if you insist on quibbling that the authoring = of the C/C++ semantics tree is in the back-end in GCC's C/C++ compiler, GNA= T has an additional semantic-tree-to-semantic-tree transduction that is abs= ent in GCC's C/C++ compiler. GCC's C/C++ compiler has exactly one semantic= s-tree, not two, regardless of whether one categorizes it as front-end or b= ack-end. > Why use 1 word when 50 will do, right?=20 Because in as little as one word, you get it factually incorrect. Then it = requires a well-worded progression of higher thought to untangle & dissect = the incorrectness lucidly for all readers to understand the finer points im= bued throughout the correction.