comp.lang.ada
 help / color / mirror / Atom feed
From: amir@iae.nsk.su (Amir Yantimirov)
Subject: Re: Endianness independance
Date: 1 Mar 2003 02:48:31 -0800
Date: 2003-03-01T10:48:31+00:00	[thread overview]
Message-ID: <5115eb96.0303010248.1b2b8d37@posting.google.com> (raw)
In-Reply-To: b3oqhj$h83$1@slb9.atl.mindspring.net

"Marin David Condic" <mcondic.auntie.spam@acm.org> wrote in message news:<b3oqhj$h83$1@slb9.atl.mindspring.net>...
> 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.

> <Lionel.DRAGHI@fr.thalesgroup.com> 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 <endianess=small, alignment=1>
     (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/



  reply	other threads:[~2003-03-01 10:48 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 [this message]
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
  -- 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