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 10.107.143.82 with SMTP id r79mr1524459iod.120.1521001738020; Tue, 13 Mar 2018 21:28:58 -0700 (PDT) X-Received: by 10.157.68.105 with SMTP id f38mr173132otj.1.1521001737884; Tue, 13 Mar 2018 21:28:57 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!paganini.bofh.team!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!e10-v6no20549itf.0!news-out.google.com!a25-v6ni257itj.0!nntp.google.com!e10-v6no20548itf.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 13 Mar 2018 21:28:57 -0700 (PDT) In-Reply-To: <1fda5564-dcdc-4fa0-bdb8-9a53a1f9d5ee@googlegroups.com> 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: <1aac45bf-2baf-4ca5-9cb5-07e1748ff6b4@googlegroups.com> <7b60b237-e3c1-4d8d-abc5-8b3f9d20e1e8@googlegroups.com> <87lgevpxd4.fsf@nightsong.com> <1fda5564-dcdc-4fa0-bdb8-9a53a1f9d5ee@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Trouble translating a C++ data-structure. From: "Dan'l Miller" Injection-Date: Wed, 14 Mar 2018 04:28:57 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:50961 Date: 2018-03-13T21:28:57-07:00 List-Id: In Alphard (of which there were several different variants described, so th= e set-union thereof), everything is a form. Here, form is not really a typ= e (although when forms in Alphard are utilized to declare datatypes, forms = sure look like parameterized/template/generic types). Here, form is not re= ally an Algol68 mode. Here, form is really neither an OO object nor a clas= s thereof. Here, form is best though of is its =E2=80=98shape=E2=80=99 sen= se, as in lifeform or to form soft clay on a potter's wheel. Everything is= a form. Integer is a form. Each statement is a form. If a programmer (o= r language-committee designer or compiler implementer) doesn't like a loopi= ng construct, the new looping construct can be =E2=80=A2inherited=E2=80=A2 = from the old one and then modified. Same with integer forms, much the same= as Ada's rich subtyping. (I strongly suspect that Ichbiah lifted Ada's su= btyping from Alphard's type-centric forms.) Associated with each form can be, optionally, a generator and rewrite rules= . A generator can be thought of as a resumptive stateful function that can= return/push a different value of a sequence multiple times from a single (= initial-)invocation (which has its stack frames locked until the generator = is terminated), but in Alphard it is better thought of as a compile-time-on= ly pure-mathematical-definition, rather than a multiply-returning subroutin= e invoked & executed at runtime. Hence, looping-construct forms (e.g., Alp= hard's for-loop form) use the counter generator, where the counter generato= r is inherited from integer along with its addition & subtraction operators= . Rewriting rules adapt Alphard's pure-mathematics notation into notations= specified by a programming-language's syntax. Examples given are: 1) Alphard itself lacks a dot notation to access fields of a record, as in = myRecord.myField. Instead, Alphard itself uses pure-mathematics function n= otation of myField(myRecord). But rewrite rules transliterate between the = 2 notations interchangeably. 2) Alphard itself lacks infix notation for operators (and postfix for that = matter). Instead, Alphard itself uses pure-mathematics function notation i= n its naturally prefix form plus(addend,addend). But rewrite rules transli= terate between the 2 notations interchangeably. There exists an academic paper from the 1970s that shows a variant of Alpha= rd that has syntax for declaring a form with a generator and with rewrite r= ules. The example given is to emulate the syntax & semantics of various lo= oping constructs in then-popular programming languages=E2=80=94PL/I, Fortra= n, and Algol68, if I recall correctly. That paper was unfortunately omitte= d from the book that I linked to above. I will need to dig through some ol= d archive CDs to find that rarer paper. Even so, forms, generators, and = =E2=80=9Cspecial rewrite rules=E2=80=9D are all described separately in the= book that I linked to above. But for those who want to cut straight to the chase scene, a) form in Alphard is analogous to an aspect in AOP and the cross-cutting c= oncerns thereof; b) form+generator in Alphard is analogous to functions+sets in pure mathema= tics notation, which itself maps rather directly into deductive logic with = processor's hardware restrictions as axiom system on which the logical dedu= ctions are founded; c) logic deduction in Alphard is analogous to aspect weaving in AOP; d) Alphard's late-1970s extensive work in provably-correct compilers via de= ductive-logic transforms is what feeds, say, an LLVM back-end (which strong= ly resembles what OCaml or even OCaml+Coq do in the modern era). The name Alphard is to call to mind a multi-headed hydra via the star Alpha= rd (Alpha Hydrae) constellation Hydra, where each form is a (co-equal-peer-= )head of the hydra. William Wulf's other project during that era (the firs= t hypervisor, as utilized in the C.mmp MIMD confederation of PDP/11s) was a= lso named Hydra. If one wants to consider what a drastically-not-GNAT modular Ada compiler w= ould look like, this would be one such re-think that had the best & brighte= st recognizable-brandname luminary minds of the same Ada83/Green-definition= era contributing to it: Wulf, Shaw, Liskov, Bentley, and so forth. Alpha= rd isn't intended to be a competitor of Ada; Alphard was obviously intended= to be the design of the layers of the onion in the compiler-front-end bene= ath Ada, PL/I, and evermore-elaborate Fortran.