comp.lang.ada
 help / color / mirror / Atom feed
From: amir@iae.nsk.su (Amir Yantimirov)
Subject: Re: Endianness independance
Date: 2 Mar 2003 01:49:37 -0800
Date: 2003-03-02T09:49:37+00:00	[thread overview]
Message-ID: <5115eb96.0303020149.4d438e40@posting.google.com> (raw)
In-Reply-To: b3qa6q$thh$1@slb0.atl.mindspring.net

"Marin David Condic" <mcondic.auntie.spam@acm.org> wrote in message news:<b3qa6q$thh$1@slb0.atl.mindspring.net>...
> Well, but if hardware is not standardized, then why would you expect
> languages to be standardized? (With respect to data representations.)
> Language X can say "All integers of any kind will be 32-bit,
> twos-compliment, network byte order....." That's nice for platforms where
> that is always available and the only integer type available. That means you
> can't use Language X on a lot of hardware platforms that don't support that
> type. Or if the hardware has other types available, you can't use those.
> Where does that get you?

First, hardware in a large degree IS follow de facto standards, except
some marginal examples. There isn't any gain to be different and
uncompatible. And I wonder what reasons were for hardware be so
diverse in the past. I think, twos-compliment, 8 bit per byte, little-
and big-endian crowds pretty much covers together 99.9% of all
systems.

Second, data representation is only model. Processor with 36 bit word
perfectly capable to operate with 8, 16, 32, 64 bits integers. The
only difference is performance. And for most cases interoperability is
far far more important. Same for hypothetical future processors with
5-state elements.

> And even if you went so far as to thoroughly dictate the exact precise
> representation of all data within the program - right down to the number of
> electrons it takes to make a bit equal to one :-) - how is that going to
> guarantee interoperability? Program X built by manufacturer X running on box
> X thinks the data going down the wire looks like this.... Program Y built by
> manufacturer Y running on box Y thinks the data looks like that..... Both
> have the same kinds of integers and floats and strings, but they're all in a
> different order. How does the language/compiler solve that?

We solves that by hand without much brain efforts so the task to
automate it is not difficult by itself. Ideally we should only mark
sertain types and interfaces that deals with communications as having
particular endianess and thats all. But including notion of endianess
(as kind of storage specifier) in existent Ada type system seems
impossible to me.

By the way, chips of different manufactures with different programs
already swarms on any PC. One my colleague feeds NVidia GeForce chip
with data, other struggles to share some algorithm between central
processor and custom multimedia chip. Guess, that language they use.
;)

Amir Yantimirov
http://www174.pair.com/yamir/programming/



  reply	other threads:[~2003-03-02  9:49 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-28 15:11 Endianness independance Lionel.DRAGHI
2003-02-28 16:10 ` Stephen Leake
2003-02-28 18:26 ` Marin David Condic
2003-03-01 10:48   ` Amir Yantimirov
2003-03-01 12:00     ` Simon Wright
2003-03-01 12:53       ` Jeffrey Creem
2003-03-01 17:26         ` Simon Wright
2003-03-01 12:47     ` Marin David Condic
2003-03-02  9:49       ` Amir Yantimirov [this message]
2003-03-03 13:29         ` Marin David Condic
2003-03-03 16:05       ` Stephen Leake
2003-03-03 17:50         ` Marin David Condic
2003-03-04  2:33         ` Jeffrey Carter
2003-03-04 17:50           ` Stephen Leake
2003-03-05  2:15             ` Jeffrey Carter
2003-03-05 17:37               ` Stephen Leake
  -- strict thread matches above, loose matches on Subject: below --
2003-02-28 17:21 Lionel.DRAGHI
2003-02-28 20:37 ` Randy Brukardt
2003-03-03 13:33 Lionel.DRAGHI
2003-03-03 16:11 ` Stephen Leake
2003-03-03 17:52 Lionel.DRAGHI
2003-03-03 20:29 ` Pascal Obry
     [not found] <BB06F6B19AC7D51181D10050DA725A10138C71@eoleclb.clb.tcfr.thales>
2003-03-03 18:38 ` David C. Hoos
2003-03-04 11:34 Lionel.DRAGHI
     [not found] <BB06F6B19AC7D51181D10050DA725A10138C75@eoleclb.clb.tcfr.thales>
2003-03-04 12:46 ` David C. Hoos, Sr.
2003-03-04 16:38   ` John Harbaugh
2003-03-04 21:25   ` Simon Wright
2003-03-05 17:28     ` Warren W. Gay VE3WWG
2003-03-05 20:15       ` Simon Wright
2003-03-05 21:54         ` Warren W. Gay VE3WWG
2003-03-05 17:49 David C. Hoos
2003-03-05 20:16 ` Simon Wright
2003-03-05 21:58   ` Warren W. Gay VE3WWG
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox