comp.lang.ada
 help / color / mirror / Atom feed
From: "Dan'l Miller" <optikos@verizon.net>
Subject: Re: Trouble translating a C++ data-structure.
Date: Tue, 13 Mar 2018 21:28:57 -0700 (PDT)
Date: 2018-03-13T21:28:57-07:00	[thread overview]
Message-ID: <f57eca77-d45c-4316-9fef-46fc0bbbe180@googlegroups.com> (raw)
In-Reply-To: <1fda5564-dcdc-4fa0-bdb8-9a53a1f9d5ee@googlegroups.com>

In Alphard (of which there were several different variants described, so the set-union thereof), everything is a form.  Here, form is not really a type (although when forms in Alphard are utilized to declare datatypes, forms sure look like parameterized/template/generic types).  Here, form is not really an Algol68 mode.  Here, form is really neither an OO object nor a class thereof.  Here, form is best though of is its ‘shape’ sense, 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 (or language-committee designer or compiler implementer) doesn't like a looping construct, the new looping construct can be •inherited• 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 subtyping 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-only pure-mathematical-definition, rather than a multiply-returning subroutine invoked & executed at runtime.  Hence, looping-construct forms (e.g., Alphard's for-loop form) use the counter generator, where the counter generator 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 notation 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 in its naturally prefix form plus(addend,addend).  But rewrite rules transliterate between the 2 notations interchangeably.

There exists an academic paper from the 1970s that shows a variant of Alphard that has syntax for declaring a form with a generator and with rewrite rules.  The example given is to emulate the syntax & semantics of various looping constructs in then-popular programming languages—PL/I, Fortran, and Algol68, if I recall correctly.  That paper was unfortunately omitted from the book that I linked to above.  I will need to dig through some old archive CDs to find that rarer paper.  Even so, forms, generators, and “special rewrite rules” 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 concerns thereof;
b) form+generator in Alphard is analogous to functions+sets in pure mathematics notation, which itself maps rather directly into deductive logic with processor's hardware restrictions as axiom system on which the logical deductions 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 deductive-logic transforms is what feeds, say, an LLVM back-end (which strongly 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 Alphard (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 first hypervisor, as utilized in the C.mmp MIMD confederation of PDP/11s) was also named Hydra.

If one wants to consider what a drastically-not-GNAT modular Ada compiler would look like, this would be one such re-think that had the best & brightest recognizable-brandname luminary minds of the same Ada83/Green-definition era contributing to it:  Wulf, Shaw, Liskov, Bentley, and so forth.  Alphard 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 beneath Ada, PL/I, and evermore-elaborate Fortran.

  reply	other threads:[~2018-03-14  4:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-08  0:37 Trouble translating a C++ data-structure Shark8
2018-03-08  0:49 ` Paul Rubin
2018-03-08  2:33 ` gautier_niouzes
2018-03-09 16:24 ` Dan'l Miller
2018-03-09 22:44   ` Shark8
2018-03-10  3:02     ` Bojan Bozovic
2018-03-10 12:45       ` Bojan Bozovic
2018-03-10 18:10         ` Shark8
2018-03-12 16:07     ` Dan'l Miller
2018-03-12 23:46     ` Randy Brukardt
2018-03-12 19:49 ` Mehdi Saada
2018-03-12 22:26   ` Shark8
2018-03-13  1:22   ` Paul Rubin
2018-03-13  2:11   ` Dan'l Miller
2018-03-13 19:51     ` Paul Rubin
2018-03-13 23:35       ` Dan'l Miller
2018-03-14  4:28         ` Dan'l Miller [this message]
2018-03-14  3:14       ` Shark8
2018-03-14  4:44         ` Bojan Bozovic
2018-03-14  5:10           ` Paul Rubin
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox