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 X-Received: by 2002:a24:378a:: with SMTP id r132-v6mr1082689itr.36.1527695947361; Wed, 30 May 2018 08:59:07 -0700 (PDT) X-Received: by 2002:a9d:5887:: with SMTP id x7-v6mr138141otg.14.1527695947192; Wed, 30 May 2018 08:59:07 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.linkpendium.com!news.linkpendium.com!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!u74-v6no403911itb.0!news-out.google.com!b185-v6ni6679itb.0!nntp.google.com!v8-v6no395833itc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 30 May 2018 08:59:06 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=47.185.233.194; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 47.185.233.194 References: <5f1e44fa-5b78-45a1-a12e-b8089d823540@googlegroups.com> <9ae54be5-0b96-4675-ad95-7a61ecc6fbd0@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <85dece7d-bb50-465e-87ca-e4ebc7af635c@googlegroups.com> Subject: Re: AI12-0218: What is the portable representation clause for processing IETF packets on little-endian machines? From: "Dan'l Miller" Injection-Date: Wed, 30 May 2018 15:59:07 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:52783 Date: 2018-05-30T08:59:06-07:00 List-Id: On Wednesday, May 30, 2018 at 10:01:03 AM UTC-5, Simon Wright wrote: > "Dmitry A. Kazakov" writes: >=20 > > But why is it C-style? Differently to C, Ada has a well defined > > semantics of all operations, shifts included >=20 > I guess I meant, the style found in Unix network programming > texts. Which typically show examples in C. C++ instead of C, but conforming to Simon's point vis a vis Dmitry's positi= on: http://www.open-std.org/jtc1/sc22/wg21/docs/TR18015.pdf Well, to take the per-IC-register piecemeal bit-twiddling approach to the e= xtreme, there is ISO TR18015 from C++-world which (in Appendix B from page = 129 through page 153) ad nauseam explains the iohw approach that is more in= Dmitry's* school of thought than in mine**. To be fair, iohw handles the = other major case of I/O-port ICs in addition to memory-mapped ICs (by uncou= thly making nice civilized memory-mapped ICs have a clunky barbaric I/O-por= t-esque personality*, but hey that was their mantra, and they stuck to it). cryptosyntax: * per-IC-register piecemeal bit-twiddling in imperative code that uses magi= c numbers (or named constants thereof) to identify the registers numericall= y (where those magic numbers might be von-Neumann addresses mapped into mem= ory or might be I/O port numbers) lucid readable code true to Jean Ichbiah's overall goals for readable lucid= Ada: ** typecasting a record-with-tightly-controlled-representation onto memory-= mapped address with the offsets calculated implicitly by the compiler as th= e octet or word offset from the IC's single memory-mapped base address