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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: SI Units Checked and Unchecked Date: Fri, 10 Aug 2018 19:34:12 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <9381f30a-a957-4477-b037-b2d60041e83e@googlegroups.com> <60ddd5ae-57e1-45e8-929c-302fabaa24ef@googlegroups.com> <96424a63-d811-4ade-88db-258f3febe60a@googlegroups.com> <99af08dd-39fb-4c1e-a247-eef9680a2abd@googlegroups.com> NNTP-Posting-Host: IzvqdhUtDGKIMCldyDtZ+w.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 X-Notice: Filtered by postfilter v. 0.8.3 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:54130 Date: 2018-08-10T19:34:12+02:00 List-Id: On 2018-08-10 19:04, Dan'l Miller wrote: > On Friday, August 10, 2018 at 9:50:53 AM UTC-5, Dmitry A. Kazakov wrote: >> In any Ada. > > … that you don't think that “Then we … class-wide cases” sentence is achievable at all in any derivative of Ada due to some fundamental flaw in Ada, and that a significantly not-Ada language is the only hope of achieving that sentence. Why so? No language change can make dynamic cases static. What the language can is to make dynamic cases type-safe, which Ada already does. Where Ada fails is in smooth transition between dynamic and static and support for user-defined semantics in static cases. E.g. in order to handle units statically we need user-defined static operations to compute the constraint of the result from the constraints of the arguments in dimensioned numeric operations. We need a mechanism to split an operation like "/" into a static part that computes the new constraint (unit) and a dynamic part that computes the value. This is a much more general issue than measurement units. The same thing is required to have static initialization of objects like constant look-up tables and maps, components of records, array elements. This is why I keep on saying that it is not about an AI on measurements units, it is about empowering the type system to make it capable to express complex structures like dimensioned types. ARG should take the problem seriously. See where ad-hoc hacking the language led us. Dynamic predicates and expression functions do not solve the problem yet significantly damaged the language. Ada 2020 will have array initialization constructs. The price of hacking. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de