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:1702:: with SMTP id 2-v6mr1528366iox.101.1527271740629; Fri, 25 May 2018 11:09:00 -0700 (PDT) X-Received: by 2002:a9d:445c:: with SMTP id f28-v6mr430798otj.2.1527271740357; Fri, 25 May 2018 11:09:00 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!feeder4.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!v8-v6no2365287itc.0!news-out.google.com!b185-v6ni1901itb.0!nntp.google.com!v8-v6no2365279itc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 25 May 2018 11:09:00 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=47.185.233.194; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 47.185.233.194 References: <5c2523c1-9ea5-453c-b80e-9cb0dcd16de0@googlegroups.com> <293cf892-1320-49e6-a25f-a36ea098cd34@googlegroups.com> <294fa0cd-ec72-4f0f-8065-0a3d5e1087fa@googlegroups.com> <1048844682.548900254.621065.laguest-archeia.com@nntp.aioe.org> <036cfae8-5963-43d2-a84c-b7b52682523c@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0d746f25-aa16-4d5c-9a9a-82c0e4c7b143@googlegroups.com> Subject: Re: DragonEgg has been revived From: "Dan'l Miller" Injection-Date: Fri, 25 May 2018 18:09:00 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:52681 Date: 2018-05-25T11:09:00-07:00 List-Id: On Friday, May 25, 2018 at 12:08:39 PM UTC-5, Simon Wright wrote: > I believe that there's considerable cross-communication between the > higher (Ada) and lower (GCC internal) stages of the compiler. No proof, > too deep for me! I might be factually incorrect, but here is what I think that currently kno= w: AIUI from my kill-off-DragonEgg investigations pursuant to GELI aforementio= ned on this thread, 0)=C2=A0GNAT's AST gets constructed during lexing & parsing. 1) The GNAT front-end grinds on _LRM_=C2=A0semantics very hard via many pas= ses of adorning the nodes of the AST to incrementally become more the full-= fledged Ada-IR tree. 1.1)=C2=A0Fascinatingly, slide 4 of the PowerPoint below indicates that GNA= T's many passes are organized literally in the chapter-order of the _LRM_. 2)=C2=A0Then the Ada-IR tree has reached its terminus state of being fully = semantically adorned. 3)=C2=A0Then and only then walked by an Ada iterator/cursor that feeds snip= pets to C-language-implemented GIGI. 4)=C2=A0GIGI then authors high GIMPLE as the C-IR tree. Once that tree-tra= nsduction completes, 5)=C2=A0then high GIMPLE begets authoring low GIMPLE,* 6)=C2=A0then low GIMPLE begets RTL,* 7)=C2=A0then RTL begets authoring target hardware-processor machine-code.* * the same in steps 5, 6, &=C2=A07 as it does for C/C++ unbeknownst to whic= h language was in the front end; Ada adds fewer than 10 treenode-types to = high GIMPLE that were lacking in C/C++-world. I say fewer than because it = appears 6 of those 10 somehow never really make it out of GIGI, as if they = are temporary, leaving 4 treenode-types leaving GIGI that are peculiar to A= da semantics, not exercised by C/C++ semantics. > > The documentation needs to be external to the source, so you don't > > have to go around the sources looking for stuff. This documentation > > can be generated from the source though. >=20 > GNAT doesn't have any publicly-visible design documentation that I'm > aware of, Well, not much more than this 11-slide PowerPoint presentation: https://www.slideserve.com/reed/the-structure-of-the-gnat-compiler which is enough to see the GIGI-to-highGIMPLE=C2=A0portion of the architect= ure on slides 2 &=C2=A07. The fully-semantically-adorned AST/Ada-IR tree t= hat is fed as input into the GIGI tree-transducer via an Ada-language itera= tor/cursor that walks that Ada-IR=C2=A0tree is described on slides 9, 10, &= =C2=A011. Historically, GENERIC, high GIMPLE, low GIMPLE, and RTL are documented at t= he URL=C2=A0below, whose WWWpage claims to be current for the forthcoming G= CC=C2=A09.0 era, but portions might be lagging behind one or more major rel= eases of GCC: https://gcc.gnu.org/onlinedocs/gccint/index.html#Top in the GENERIC=C2=A0&=C2=A0GIMPLE URLs. Some people say that GCC's C/C++ compiler authors high GIMPLE directly skip= ping the older-era GENERIC, whereas this documentation says that high GIMPL= E is a subset of GENERIC, so whatever that state of affairs really really m= eans. (e.g., why does high GIMPLE have a different name than GENERIC then?= I don't know. I haven't reached full grok yet.)