comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison<dennison@telepath.com>
Subject: Re: adasockets and adatypes
Date: Tue, 04 Sep 2001 18:53:06 GMT
Date: 2001-09-04T18:53:06+00:00	[thread overview]
Message-ID: <mq9l7.3640$4z.9769@www.newsranger.com> (raw)
In-Reply-To: mailman.999618666.14306.comp.lang.ada@ada.eu.org

In article <mailman.999618666.14306.comp.lang.ada@ada.eu.org>, David C. Hoos
says...
>From: "Ted Dennison" <dennison@telepath.com>
>One can't.  That's why when stream format is important, one should define
>his own types -- although I've never found a reason not to use the language-

For a single-developer app that might be a good way to handle it. But in many
situations this is just not a feasible solution. For a non-trivial systems its a
*lot* of work to redefine every IO attribute for every type. Some *can't* easily
be redefined (I think 'Class'Output is like this). Let's also not forget that
we've now distributed responsibility for the I/O working properly out to every
single author and maintainer of every single type in the system. 

>> If you only have 2 implementations to get talking, it is fairly easy to
>> massage one end until it talks like the other. That isn't the same thing as 
>> true portability.
>I agree. one should define what the stream should look like from the
>beginning.
>For example, for Annex E, GNAT uses the XDR format defined by Sun.

Ahhh. That's a very good example, in that they shared a small part of this
problem. They still don't have to worry about differing vendor implementations,
but they at least had to worry about different platforms. They solved this
smaller problem by creating a special package that contains all the routines
that will be used by the base type's IO attributes to construct their stream
representations. Users can then override this package with one of their own
devising (including the XDR-based one that comes with GLADE).

Its cool that they did this, but this kind of hook into the inner workings of
the compiler is most definitely *not* part of the Ada standard. It should go
without saying that it won't come close to working with any other compiler.
Perhaps that issue should be addressed for a future language revision. However,
for now there is clearly no good way to accomplish general stream data
portability within Ada. Your only alternatives today are to subset the problem
into one of:

o  - portability when only using Gnat with the XDR version of
System.Stream_Attributes installed
o  - portability when only using a certian subset of types
o  - portability between n specific compilers/platforms (n > 2 only for
masochists)

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com



  reply	other threads:[~2001-09-04 18:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-04 10:53 adasockets and adatypes Tony Gair
2001-09-04 11:37 ` David C. Hoos, Sr.
2001-09-04 12:17   ` Florian Weimer
2001-09-04 14:55     ` David C. Hoos
2001-09-04 15:33       ` Ted Dennison
2001-09-04 15:53         ` David C. Hoos
2001-09-04 18:53           ` Ted Dennison [this message]
2001-09-04 20:44             ` David C. Hoos
2001-09-04 21:35               ` Ted Dennison
2001-09-04 15:58         ` Marin David Condic
2001-09-05  9:13   ` Tony Gair
2001-09-04 12:02 ` Marc A. Criley
2001-09-04 13:43 ` Marin David Condic
2001-09-04 22:12   ` Simon Wright
2001-09-06  7:04     ` Ole-Hjalmar Kristensen
2001-09-07 13:16       ` Peter Dulimov
2001-09-07 14:46         ` Ted Dennison
2001-09-08  5:51         ` Simon Wright
2001-09-06 14:16     ` Marin David Condic
replies disabled

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