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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: operation can be dispatching in only one type Date: Wed, 2 Dec 2015 14:31:44 +0100 Organization: cbb software GmbH Message-ID: <1cdfm5ay149ex.zcidmoq73rha$.dlg@40tude.net> References: <1ephv5ugr5mib$.9ehadf3dddct$.dlg@40tude.net> <1nf8wc05tjtvf$.1ctjb9hsr0qsp.dlg@40tude.net> <8132c558-aec2-41f4-8024-4a75a2d497ae@googlegroups.com> <17c8a7kqoxvff.aa1raqev6xlu$.dlg@40tude.net> <75a4c7be-391d-4e5d-9e6e-23607132c943@googlegroups.com> <343b78d1-c1ba-40d3-af80-e18de45f2e3d@googlegroups.com> <11das66l3vhic$.1stkau3dqp6ld.dlg@40tude.net> <6y03ogx0fsk8$.n0ldd6cud931$.dlg@40tude.net> <51sbiz7sr8o7$.9wqd8z5xjlf8$.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: bqgfK7NL3xTHnr0WRaLl4g.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:28618 Date: 2015-12-02T14:31:44+01:00 List-Id: On Wed, 2 Dec 2015 14:06:04 +0100, G.B. wrote: > On 01.12.15 18:58, Dmitry A. Kazakov wrote: > >> Less defined by the RM then better. > > (OK, yet, taking this to absurd extremes, the ideal language > would be undefined...) It is similar to the minimum set of axioms in a formal system, or a minimal instruction set, minimal alphabet, minimal numeral set etc. Of course it does not mean that the ideal language must be minimal. But blown languages are not ideal either. >> Any predefined semantics is >> a necessary evil. If not necessary, then just evil. > > How much predefined semantics is (un)necessary? The lower boundary is Turing completeness, obviously. > In what circumstances? > > How much less will be more productive? And conducive to correct > use of the language? How? (request for example below) > For example, Apple is making "object properties" (dot notation) > a convenience for connecting them to key-value coding. There is some optimum. But anything you could move at the library level and beyond should be. >>> The compiler now needs to ensure something different when >>> translating "rec.x". >> >> The compiler needs to ensure what the programmer means (assuming correct >> language use) > > Right. Also, the programmer might want ways of expressing volatility > of virtual components, of addressing representation issues, etc. Syntactically? Probably not. At least not in Ada's way where same syntax is used for. > In this regard, could there be a novel approach to protecting > access when defining ".X" instead of defining a plain old prim_op? There is nothing specifically "protecting" in dot-syntax. It is used for all sorts of calls in Ada. >> For *any* legal construct the compiler should emit >> code with a predictable effect. Otherwise the language is ill-defined. > > Of course, what matters is the kind of predictability that a reviewer > needs in order to check, efficiently, that the compiled code is of > a kind that he could have predicted. It is not achievable in a higher level language, only in Assembler. Neither it is required. The reader should understand the semantics and programmer's intent rather than machine instructions generated. >> I don't see how Employee.Salary is less readable, >> predictable, etc than Get_Salary(Employee). > > I'll be fine with ".X" if it offers any real benefit at virtually > no cost. So, how will a record abstraction be usefully different > from a private type? Because in this case Employee is seen as a record in the problem space. > Can you give an example, say, built around > > procedure Op (X : ...; V : record'Class); -- (sic) Example of what? Of tuples? They are everywhere in almost all problem spaces. Simply observe that an implementation of tuple need not to be a record. E.g. Color with RGB , HLS, L*a*b record views. > For example, I have often longed for a notation that expresses > message sending. You should look no further than task interfaces. Granted, they should be fixed. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de