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=0.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM, PDS_OTHER_BAD_TLD autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:a24:6b92:: with SMTP id v140mr11013220itc.161.1556318463920; Fri, 26 Apr 2019 15:41:03 -0700 (PDT) X-Received: by 2002:a05:6830:14d8:: with SMTP id t24mr29695583otq.303.1556318463718; Fri, 26 Apr 2019 15:41:03 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!136no227435itk.0!news-out.google.com!w17ni187itb.0!nntp.google.com!136no227433itk.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 26 Apr 2019 15:41:03 -0700 (PDT) In-Reply-To: <5794bba8-6167-4648-9631-732eb0e1a5ac@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=146.5.2.29; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 146.5.2.29 References: <0ee94773-9432-4117-ae73-6763347809ea@googlegroups.com> <271e5a12-9292-4078-a2b0-7bba666327ae@googlegroups.com> <5794bba8-6167-4648-9631-732eb0e1a5ac@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <1a915f9c-2560-4668-9375-764271dfbffb@googlegroups.com> Subject: Re: Ada programmers: Edward Fish - interview From: Shark8 Injection-Date: Fri, 26 Apr 2019 22:41:03 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:56194 Date: 2019-04-26T15:41:03-07:00 List-Id: On Friday, April 26, 2019 at 12:52:46 PM UTC-6, Optikos wrote: [snip] > >=20 > > So, obviously, the idea isn't new =E2=80=94 this invites some questions= though: > > (a) why didn't any of these take off? >=20 > Two-level grammars did not take off because they incompletely capture the= entire semantic meaning of the AARM. The semantic meaning is the interesting part; arguably the only part that m= atters =E2=80=94 especially as I am of the opinion that text-based source-p= rograms are absolutely the wrong way to address programming. As I envision a whole tool-suite for Ada, it's not text that should be the = "lingua franca", but rather a structured and meaningful form. (eg the inter= mediate representation.) -- but Byron needn't go that far, as I doubt many = people would *want* to get in on a whole Integrated Development Environment= . I get a bit of intuitive feel that limiting the scope of the Byron project = to the role of "compiler" (albeit keeping things 'open'/modular enough that= it could be used in a real IDE) would invite more people being willing to = contribute. > > (b) what difficulties did they encounter that may still be extant? >=20 > Two-level grammars are unnatural for human beings to think in. Other app= roaches such as Z/Zed travel a different avenue. Other avenues might exist= too. Perhaps the problem is being tied to text and textual modes of thought, as = the term 'grammar' indicates, there is a great deal invested into treating = programming languages in a textual-linguistic sense. > > (c) how much work would it be to build on any of these as opposed to a= ll-new development? >=20 > Much effort. But then again, GNAT expended an immense amount of effort d= oing it twice: > 1) one transliteration of the prose into an Ada-centric semantically-anno= tated syntax tree written in Ada language > then once again: > 2) one transliteration of the Ada-centric semantically-annotated syntax t= ree tree-transducer into C/C++-centric semantically-annotated tree written = in C. >=20 > It seems that human beings manually transliterating the AARM twice is onc= e too many. A while back, someone mentioned taking a look at "Alphard: Form and Content= " -- http://libgen.io/search.php?req=3D978-1-4612-5979-4&lg_topic=3Dlibgen&= open=3D0&view=3Dsimple&res=3D25&phrase=3D1&column=3Ddef / https://d-m.bksdl= .xyz/download/book/5c63f88850b4253978a11370 -- I haven't had a chance to bu= t according to wikipwdia it seems interesting/intriguing and may have some = applicability here: "Its main innovative feature was the introduction of the 'form' datatype, w= hich combines a specification and a procedural (executable) implementation.= It also took the generator from IPL-V, as well as the mapping functions fr= om Lisp and made it general case." > > (d) what impacts would later standards (95, 2005, 2012, 2020) have on = both the extant work as well as the ability for the underlying designs to a= ddress it? >=20 > Conversely, which other languages that have analogous features (e.g., cov= ariant OO polymorphism; parameterized types) have similar semantic definiti= on of behavior=E2=80=94including academic research languages? I'm not sure what you're getting at here. I was entertaining the notion of = a sort of executable and verifiable semantic-describing language as being a= ppropriate here. This could be the meta-language described in the tail-end = of the interview. In the sense of the above "meaningful data-structures" perhaps this would b= e realized as an "execute" method on the nodes of the structure. If the str= ucture is guaranteed to be correct (which we could do on construction) then= the execution of these nodes could generate the proper parser/processing-u= nit. > > (e) are there modern techniques that would work better? [Note: "newer"= =E2=89=A0 "better".] >=20 > Two-level grammars seem to lack enough stepwise refinement. Interesting. I wonder if this could be addressed via the same technique of "parselets" t= hat is used in this demo/tutorial of Pratt-parsers: http://journal.stuffwit= hstuff.com/2011/03/19/pratt-parsers-expression-parsing-made-easy/ > What if Byron would take as input a) the AARM transliterated to a machine= -readable encoding of its semantics in some stepwise-refinement language an= d b) your design document transliterated to a machine-readable encoding of = its semantics in some stepwise-refinement language, and then the compiler g= enerator stitched the 2 together, not entirely unlike AOP weavers (on stero= ids). The question is: what is that machine-readable encoding of semantic= s that begets several stages of stepwise refinement via programmatic-transf= orm multistage programming =C3=A1 la MetaOCaml? Is it Z/Zed on the front-e= nd driving MetaOCaml programs as some sort of automated Vienna development = method (VDM)? Hm, an interesting idea. Though, I am pretty unfamiliar with AOP weavers or Vienna development metho= d. How would these tie in together? > Or is it TRW's SEMANOL? Would SEMANOL+Ada sufficiently approximate Z+Met= aOCaml as a stepwise-refinement multistage-programming environment for gene= rator of code generator of =E2=80=A6 of code generator? I have no idea; other than that abstract/paper I don't think I've seen Sema= nol referred to anywhere.=20 > The goal of SEMANOL+Ada or Z+MetaOCaml would be to generate the existing = Byron source code (as touched up as per the revised design document). I don't know; the extant code-base isn't the greatest, and is all by-hand: = mine. > Once the generation of syntactic parser was demonstrated, generation of m= ore-sophisticated semantics in fresh Byron source code naturally follow.=20 Does it? I'm not convinced: if we were to start/focus on capturing the semantics and= rules, then I think the syntactic would follow easily, but the other way m= ight me more difficult. Just as the write method on a stream is much easier= than a read -- example: (23, Dave, 17) can be easily put in a stream as 23= Dave17, but there's a problem if the data written is (21,14,13) as it produ= ces 211413 which is itself a proper integer. > > (f) what *is* the best way to engineer/design a compiler for Ada? >=20 > The best way would be one that transliterates the AARM into a machine-rea= dable semantic language (once) for then fully-automated derivation of the c= ompiler. I would claim that some of the =E2=80=9Cnumerous passes=E2=80=9D = performed by GNAT are actually invariants that can be factored out to compi= ler-authoring-time instead of program-parsing-time. I would be unsurprised if you're right about that. > Another definition of the best way would be whatever attracts people and/= or funding to pioneer something new and innovative, instead of me-too and i= mitative. And there's the sticking point: absolutely none of my non-employment projec= ts since graduation have had any other contributors. (I'm certainly no Torv= alds.)