comp.lang.ada
 help / color / mirror / Atom feed
* RE: Endianness independance
@ 2003-02-28 17:21 Lionel.DRAGHI
  2003-02-28 20:37 ` Randy Brukardt
  0 siblings, 1 reply; 33+ messages in thread
From: Lionel.DRAGHI @ 2003-02-28 17:21 UTC (permalink / raw)
  To: comp.lang.ada



| -----Message d'origine-----
| De: Stephen Leake [mailto:Stephen.A.Leake@nasa.gov]
..
| I was not aware that he had made a proposal that required language
| revision. 
| 
| I use a variant of his technique now, with good results (once I
| actually _know_ what the hardware endianness is :).
| 
You are probably speaking of his technique to get Bit_Order attribute effect
with Ada 83 code, presented in the "Endian-Independent Record Representation
Clauses" paper?

I was speaking of "A Proposal for Endian-Portable Record Representation
Clauses", which suggest to get non default bit order support mandatory, and
the byte offset (the number between "at" and "range" within representation
clauses) related to machine scalar instead of byte.

As i understand it, this proposal cause no upward compatibility problem, but
i have no idea of the rework it could cause within compilers. 

-- 
Lionel Draghi.




^ permalink raw reply	[flat|nested] 33+ messages in thread
* Re: Endianness independance
@ 2003-03-05 17:49 David C. Hoos
  2003-03-05 20:16 ` Simon Wright
  0 siblings, 1 reply; 33+ messages in thread
From: David C. Hoos @ 2003-03-05 17:49 UTC (permalink / raw)
  To: comp.lang.ada mail to news gateway


----- Original Message ----- 
From: "Warren W. Gay VE3WWG" <ve3wwg@cogeco.ca>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: Wednesday, March 05, 2003 11:28 AM
Subject: Re: Endianness independance
<snip>
> If you look carefully at GLADE, you will notice that all that is
> being done there is "byte swapping". There is more to independent
> network formats than that (it just happens to work with _most_
> modern platforms at the moment).
> 
> The problem that XDR solved was that they specified a network
> independent format for floating point types. If you try to use
> GLADE on hosts that use different floating point formats, then
> no amount of byte swapping is going to make them compatible!
> 
Agreed.  However, at the end of the day, there is no solution at all
for communication between machines with differing ranges for the
exponent and mantissa, so the notion of platform independence
must have certain caveats about some details of the platforms which
must at least support some level of commonality.




^ permalink raw reply	[flat|nested] 33+ messages in thread
[parent not found: <BB06F6B19AC7D51181D10050DA725A10138C75@eoleclb.clb.tcfr.thales>]
* RE: Endianness independance
@ 2003-03-04 11:34 Lionel.DRAGHI
  0 siblings, 0 replies; 33+ messages in thread
From: Lionel.DRAGHI @ 2003-03-04 11:34 UTC (permalink / raw)
  To: comp.lang.ada



| -----Message d'origine-----
| De: David C. Hoos [mailto:david.c.hoos.sr@ada95.com]
...
| Yes, Glade does it, but the only thing Glade has to worry 
| about is that
| the stream representation is independent of hardware platform and OS.
| 
| Glade does this by providing a replacement body for the
| System.Stream_Attributes package.
| 
| However, I have done a lot of endianess-independent work where a
| specific network representation is required -- i.e., where an Ada
| program has to communicate with a program writen in a language
| not necessarily known to me.
| 
OK, but i don't pretend to get this general case taken into account within
the language scope, altrough some 
for My_Stream'representation use XDR; 
could be great! 

My point is just about interoperability between the same Ada code compiled
on two platform. I want both exe to put the same thing in the stream.
It's not the case even with a representation clause, and i feel this is
abnormal. 
I know it's far from easy to achieve, but i thought Norman's proposal was
helping a lot...

Lionel



^ permalink raw reply	[flat|nested] 33+ messages in thread
[parent not found: <BB06F6B19AC7D51181D10050DA725A10138C71@eoleclb.clb.tcfr.thales>]
* RE: Endianness independance
@ 2003-03-03 17:52 Lionel.DRAGHI
  2003-03-03 20:29 ` Pascal Obry
  0 siblings, 1 reply; 33+ messages in thread
From: Lionel.DRAGHI @ 2003-03-03 17:52 UTC (permalink / raw)
  To: comp.lang.ada

| -----Message d'origine-----
| De: Stephen Leake [mailto:Stephen.A.Leake@nasa.gov]
...
| It is not possible to get compatible stream representations via
| representation clauses.
| 
| You must override 'Write and 'Read to get that. 
| 
| The reason is that representation clauses can't swap bytes within
| scalars (integers and floats), as is required by endian-independant
| stream representations.
| 
This is what i called the "easy" part of the job. 
But, obviously i suppose the compiler will do the job. If i must override
Stream attributes, i won't consider it so easy :-)

I can't believe it's impossible, after all, this is actually done by Glade,
isn't it?

Lionel Draghi.




^ permalink raw reply	[flat|nested] 33+ messages in thread
* RE: Endianness independance
@ 2003-03-03 13:33 Lionel.DRAGHI
  2003-03-03 16:11 ` Stephen Leake
  0 siblings, 1 reply; 33+ messages in thread
From: Lionel.DRAGHI @ 2003-03-03 13:33 UTC (permalink / raw)
  To: comp.lang.ada



| -----Message d'origine-----
| De: Marin David Condic [mailto:mcondic.auntie.spam@acm.org]
...
| 
| Realistically, the answer is to assess the communications 
| mechanisms needed,
| establish a clearly defined protocol & representation and 
| then build your
| software to deal with that. Ada can be very good at handling the
| representation selected, but it really can't define the 
| representation for
| you.

I agree with this. 
What i am complaining about, is that you can't just rely on representation
clauses to have interoperability between the same code compiled on two
different platform, and exchanging data through a stream socket for exemple.
I think that the representation/size/alignment clauses could give enough
informations to the compiler to ensure interoperability (provided RM
modifications). 

Am i wrong? As said Amir Yantimirov:
"But including notion of endianess (as kind of storage specifier) 
in existent Ada type system seems impossible to me."

Note that Norman Cohen's paper do not address the whole interoperability
problem, he just propose a way to portably specify "a data layout". However,
this is, i think, the most difficult part of the job.

Lionel Draghi 




^ permalink raw reply	[flat|nested] 33+ messages in thread
* Endianness independance
@ 2003-02-28 15:11 Lionel.DRAGHI
  2003-02-28 16:10 ` Stephen Leake
  2003-02-28 18:26 ` Marin David Condic
  0 siblings, 2 replies; 33+ messages in thread
From: Lionel.DRAGHI @ 2003-02-28 15:11 UTC (permalink / raw)
  To: comp.lang.ada



| -----Message d'origine-----
| De: Marin David Condic [mailto:mcondic.auntie.spam@acm.org]
...
| prone because of common data representation - then Ada is an abysmal
| failure. The Ada standard has almost nothing at all to say about the
| representation of data as it gets out of the program and it 
| has gaping holes
...
One big step towards interoperability and portability could be
Endian-Portable record representation.

Does someone knows if Norman H. Cohen proposal for Endian-Portable record
representation clauses is examined within language revision?

Lionel Draghi.



^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2003-03-05 21:58 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-28 17:21 Endianness independance Lionel.DRAGHI
2003-02-28 20:37 ` Randy Brukardt
  -- strict thread matches above, loose matches on Subject: below --
2003-03-05 17:49 David C. Hoos
2003-03-05 20:16 ` Simon Wright
2003-03-05 21:58   ` Warren W. Gay VE3WWG
     [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-04 11:34 Lionel.DRAGHI
     [not found] <BB06F6B19AC7D51181D10050DA725A10138C71@eoleclb.clb.tcfr.thales>
2003-03-03 18:38 ` David C. Hoos
2003-03-03 17:52 Lionel.DRAGHI
2003-03-03 20:29 ` Pascal Obry
2003-03-03 13:33 Lionel.DRAGHI
2003-03-03 16:11 ` Stephen Leake
2003-02-28 15:11 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
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

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