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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,febd9e55846c9556 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-01 02:48:31 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: amir@iae.nsk.su (Amir Yantimirov) Newsgroups: comp.lang.ada Subject: Re: Endianness independance Date: 1 Mar 2003 02:48:31 -0800 Organization: http://groups.google.com/ Message-ID: <5115eb96.0303010248.1b2b8d37@posting.google.com> References: NNTP-Posting-Host: 81.1.215.198 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1046515711 8244 127.0.0.1 (1 Mar 2003 10:48:31 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 1 Mar 2003 10:48:31 GMT Xref: archiver1.google.com comp.lang.ada:34762 Date: 2003-03-01T10:48:31+00:00 List-Id: "Marin David Condic" wrote in message news:... > This isn't really the proper domain for a programming language. There are > too many machine architectures, communication mechanisms and data > representations out there for a language to try to standardize them all. The > language wants to be targetable to a multitude of hardware, so it has to be > abstracted from underlying representation. By picking one form of endianness > over another or one form of floating point representation over another or > whatever other possible representations one might select, it would be ruling > out use of the language on a whole range of equipment. This isn't really the > place one tries to create interoperability. I think this sentence isn't true at least for 5 years already. Interoperability is so crucial that today where is no excuse for existance of hardware what don't support common data representation. As you pointed in other thread this wasn't a goal when Ada was created. Contrary, such implicit "genericity" is a common trait of all older languages. And opposite, a newer languages as Java and C# exactly specify representation of integer and floating point types. This is a direct answer to common demand of developers. So we lost seductive ability to write single code for various representation of data, do we? The obvious answer is that genericity should be explicit only. > wrote in message > news:mailman.6.1046445067.1343.comp.lang.ada@ada.eu.org... > > ... > > One big step towards interoperability and portability could be > > Endian-Portable record representation. > > > > Does someone knows if for Endian-Portable record > > representation clauses is examined within language revision? > > > > Lionel Draghi. I don't know Norman H. Cohen proposal but that hou I see it can be done. Primitive types are defined as bitstrings of various length. Endianess is a way to store primitives to memory/stream. Only small/big endianess are supported by compiler, all other should be implemented by hands. Any type/variable has one of endianess setting: neutral (assumes native), small-endian, big-endian. For example: type TGAFileHeader = record (all staff) end record; You works with record as usual and toss it as bytes sequence to file and this works right on any system. Amir Yantimirov http://www174.pair.com/yamir/programming/