comp.lang.ada
 help / color / mirror / Atom feed
From: "John R. Strohm" <strohm@airmail.net>
Subject: Re: 64bit access to an array of 8bit values
Date: Thu, 7 Mar 2002 12:03:45 -0800
Date: 2002-03-07T12:03:45-08:00	[thread overview]
Message-ID: <A2A9425972641EE4.F863839E45E33B4A.B25979C9D73B9F75@lp.airnews.net> (raw)
In-Reply-To: Lnnh8.54694$%b6.13828382@typhoon.ne.ipsvc.net

"Jeffrey Creem" <jeff@thecreems.com> wrote in message
news:Lnnh8.54694$%b6.13828382@typhoon.ne.ipsvc.net...
> However, my initial concern still stands (and this is not just true here
but
> I've seen similar discussions crop up
> on the C++ and other mailing lists)... The problem with the way the
response
> is phrased is people walk away with the understanding that they can not
use
> the simple straightforward approach in Ada so they have to resort to
> something more complicated. In fact, the problems you point out are common
> to all languages (with the possible exception of Java which always runs
with
> the same endianness regardless of host but then of course would probably
now
> allow the evil pointer arithmetic that seemed to be desired so perhaps in
> that case the answer really could have been you can't do it like
> that  in XX lang).

No.

Let me try it again.

The problem with the "simple straightforward approach", in Ada or in any
other language, is that it MAY OR MAY NOT WORK.  A "simple straightforward"
solution that DOESN'T WORK is not a solution.  Rather, it is a waste of
time.

In this case, the "simple straightforward approach" INHERENTLY inherits the
endian-ness of the target machine, which MAY OR MAY NOT match the endianness
of the simulated instruction set architecture.  If the endiannesses do not
match, the "simple straightforward approach" fails, forcing the programmer
to spend much time scratching his head, wondering what went wrong, and then
eventually figuring out that he has an endianness problem.

Even if the language is specified to run with the same endianness,
regardless of target architecture, requiring the compiler to generate
appropriate byteswapping code, the "simple straightforward approach in Ada"
STILL fails if the simulated instruction set architecture endianness does
not match the language endianness.

Part of the programmer's job is recognizing when the "simple straightforward
approach", in Ada, or in any other language, might not work.






  reply	other threads:[~2002-03-07 20:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-03 14:58 64bit access to an array of 8bit values Dave Poirier
2002-03-03 15:38 ` Jim Rogers
2002-03-03 18:02 ` John R. Strohm
2002-03-03 16:39   ` Dave Poirier
2002-03-03 17:27   ` Jeffrey Creem
2002-03-05 20:49     ` John R. Strohm
2002-03-05 23:52       ` Jeffrey Creem
2002-03-06  7:30         ` John R. Strohm
2002-03-06 11:50           ` Jeffrey Creem
2002-03-07 20:03             ` John R. Strohm [this message]
2002-03-04 10:29   ` Robert Dewar
2002-03-04 13:02     ` Larry Kilgallen
2002-03-04 13:41       ` Dave Poirier
2002-03-03 22:24 ` David C. Hoos, Sr.
2002-03-03 22:51   ` Dave Poirier
2002-03-04  2:40     ` David C. Hoos, Sr.
2002-03-04  4:08     ` David Starner
2002-03-04 10:31   ` Robert Dewar
2002-03-04 18:00   ` Warren W. Gay VE3WWG
2002-03-04  3:15 ` Pat Rogers
2002-03-04  7:23 ` Jeffrey Carter
replies disabled

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