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 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,583275b6950bf4e6 X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,59ec73856b699922 X-Google-Attributes: gid1108a1,public X-Google-Thread: fdb77,5f529c91be2ac930 X-Google-Attributes: gidfdb77,public X-Google-ArrivalTime: 2003-04-29 00:51:09 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!dialin-145-254-036-215.arcor-ip.NET!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.java.advocacy,comp.object,comp.lang.ada Subject: Re: the Ada mandate, and why it collapsed and died (was): 64 bit addressing and OOP Followup-To: comp.lang.java.advocacy Date: Tue, 29 Apr 2003 09:53:05 +0200 Organization: At home Message-ID: References: <3E4E8F8C.9C096985@adaworks.com> <9fa75d42.0302250710.5549baaf@posting.google.com> <3E5C7033.BD5DC462@adaworks.com> <9fa75d42.0302260618.7506cba7@posting.google.com> <3E5CF5C6.84822F57@adaworks.com> <8qkczsAcGcn+Ew83@nildram.co.uk> <3EA04A1E.CAFC1FEF@adaworks.com> <9fa75d42.0304221126.7112b7d5@posting.google.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-036-215.arcor-ip.net (145.254.36.215) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 1051602667 11786083 145.254.36.215 (16 [77047]) User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.java.advocacy:62884 comp.object:62254 comp.lang.ada:36719 Date: 2003-04-29T09:53:05+02:00 List-Id: Robert A Duff wrote: > "Dmitry A. Kazakov" writes: > >> Robert A Duff wrote: >> >> > Yes, by "L-value", I meant on the left-hand side of an assignment, or >> > an >> > 'out' parameter, or similar things. If X(1..80) is just syntactic >> > sugar for a function call Slice(X, 1, 80) or Slice(X, First => 1, Last >> > => 80), then it would be little trouble for the Ada compiler. >> >> Do you mean that Slice (...) would always have a copy semantics? > > Yes. Ooch >> > And I would think it would be but a minor convenience for the >> > programmer. >> >> > But when slices are used as L-values, there are various interactions >> > with packing and whatnot that cause compiler complexity. >> >> Isn't it already there because array elements can be also L-values? Or >> that objects of some types have to be constructed in-place? I mean, with >> or without slices, one cannot get rid of this problem anyway. > > No, I think slices-as-L-values cause compiler complexity beyond what > components-as-L-values do. I suppose it is not a big problem to generate a loop, so it must be something else. Maybe you mean things like optimization of an assignment into a memory copy if no element finalization required? But we do need that! Randy Brukardt have already mentioned a buffer extension technique based on slices. I am using it all the time in generic containers in hope that for non-controlled types it will become just a memory copy. Now let we remove slices. Then to achive the same level of optimization, the compiler has to be able to redice a hand-written loop (+unpack/pack rubbish generated) to a memory copy. Is it easier? >From a global perspective. To me slices is a good example of how things *should* be done. I mean the issues like: - unconstrained string vs. constrained string; - unconstrained discriminated object vs. a dynamically constrained one; - class-wide object vs. specific one Only strings and slices have it right. The dope is used only when necessary. On contrary discriminants and tags are always there. Which makes, for instance, the problem of measurement units unsolvable. From this point of view removing slices would be a step back. -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de