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-Thread: 103376,43ad9ab56ebde91c X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.191.41 with SMTP id gv9mr1117170pbc.5.1323852962596; Wed, 14 Dec 2011 00:56:02 -0800 (PST) Path: lh20ni20874pbb.0!nntp.google.com!news2.google.com!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Does Ada support endiannes? Date: Wed, 14 Dec 2011 09:56:06 +0100 Organization: cbb software GmbH Message-ID: <16jibtpb9f2o4.1pf3ro8hb8qq2.dlg@40tude.net> References: <23835087-313f-427c-b37e-4ff1bdef9d57@r6g2000yqr.googlegroups.com> <20e631fc-e7b4-41ca-be0f-aab8be3f9a25@f33g2000yqh.googlegroups.com> <53n2sd7edt5i.1boh4452h0aks.dlg@40tude.net> <1kc5n51.ffg0umddufyfN%csampson@inetworld.net> <1c2ax12bptm2g.gifwv5vndpxe$.dlg@40tude.net> <1kc8f2j.132xw621jmu761N%csampson@inetworld.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2011-12-14T09:56:06+01:00 List-Id: On Tue, 13 Dec 2011 21:19:07 -0800, Charles H. Sampson wrote: > Dmitry A. Kazakov wrote: > >> No. The Ada's design goal was to allow the programmer to describe the >> semantics the data types involved and to program in that terms. >> Representation clauses rather defeat that idea than support it. The number >> read from the wire must look and feel as a number rather than some messy >> record, which cannot be a numeric parameter of a generic, has no 'Image, no >> meaningful literals etc... > > I think I see the place where we have the greatest disagreement in > concept. To me, in general, data coming "over a wire" are just a stream > of bits until we have interpreted them and found out what they mean. Right, I prefer typed approaches over untyped ones. This is BTW why I prefer Ada over other languages. Stream of bits is a transport layer, at best, to be hidden under higher protocol layers, spilling properly typed objects to the clients. No conversions. One advantage of this approach is that the transport being properly encapsulated could be easily replaced. > At that requires a bit mor writing than your approach, Dmitry, but > that's o. k. with me. The design of Ada was permitted to require > "extra" writing for the purpose of clarity of code. I think the problem here is not the volume of the code, but an untyped nature of it. Note that if the native and remote objects were distinct types (not subtypes), you would not be able to have them as views of the *same* object. Thus you would have to convert the remote object to a native one. But once you had the latter you would not need the former anymore. The next step is just to get rid of it. Why anybody (a client) should see it at all? That is my approach. As a by-product you get a highly portable code as Gautier pointed out in another response. IMO, representation clauses are evil and not Ada (TM). -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de