comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Which is right here - GNAT or OA ?
Date: 1999/05/31
Date: 1999-05-31T00:00:00+00:00	[thread overview]
Message-ID: <7iuqkc$ln6$1@nnrp1.deja.com> (raw)
In-Reply-To: 928174549.336.98@news.remarQ.com

In article <928174549.336.98@news.remarQ.com>,
  "Vladimir Olensky" <vladimir_olensky@yahoo.com> wrote:
> As a matter of fact this is amazingly simple.

No, doing this without adding unacceptable overhead is not
simple, and in fact is simply not practical.

> If I can do this
> check at a run time myself  why RTS can not do the same ?

Because the cost is too high

> The cost of this is one  additional  hidden field in the type
> representation which  is set to needed value during object
> creation.

Yes, and that cost is much too high, for example, if you have
a simple linked list type, you could be talking about adding
a storage overhead of 20-25%.

Surely you must realize your method is completely obvious! The
fact that the RM makes this situation erroneous is an explicit
indication that the designers of the language have considered
your solution and rejected it as introducing excessive overhead.

The design is very sensitive to avoiding unnecessary storage
use. FOr example, the confusing difference between:

   A : aliased constant String (1 .. 80) := " 80 chars ...";
   A : aliased constant String           := " 80 chars ...";

is solely to save the 8 bytes that would otherwise be required
for the bounds in the first case.





>  Soon I demonstrate this simple technique in set of "talking"
examples that
> are almost ready to be posted to AdaPower.
> The same thing could be done by the compiler itself.  There
even will be no
> need to have additional public run time attributes.
> Compiler or allocator sets  this field during object creation
and  RTS can
> check this field and do what needed depending on value of this
field upon
> object deallocation request. This could be very handy.
>
> >
> >Another but related thing surprises me---it's AARM
12.5.4(4.a):
> >
> >| If no _modifier applies to the formal, then the actual type
may be
> >| either a pool-specific or a general access-to-variable
type.
> >
> >I can't imagine any reason why an access-to-variable type
should be
> >allowed as an actual parameter for a formal access type
without an
> >`all' modifier.  If this was changed, an access-to-variable
would not be
> >allowed as a parameter in an instantiation of
Ada.Unchecked_Deallocation,
> >which seems quite reasonable to me.  (I don't claim that the
language
> >definition inadequate here, I simply can't make sense out of
it, which
> >is very likely my own fault. ;)
>
> Yes, very interesting,  I agree, it does not go all along the
line with Ada
> strong type checking.
> In some circumstances it may cause the same result that was
demonstrated in
> my small demo.
>
> Regards,
>
> Vladimir Olensky
>
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




  reply	other threads:[~1999-05-31  0:00 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-30  0:00 Which is right here - GNAT or OA ? Vladimir Olensky
1999-05-30  0:00 ` Robert Dewar
1999-05-31  0:00   ` Vladimir Olensky
1999-05-31  0:00     ` Robert Dewar
1999-06-01  0:00   ` dennison
1999-05-30  0:00 ` Florian Weimer
1999-05-31  0:00   ` Vladimir Olensky
1999-05-31  0:00     ` Robert Dewar [this message]
1999-06-05  0:00       ` Vladimir Olensky
1999-06-05  0:00         ` Florian Weimer
1999-06-05  0:00         ` Vladimir Olensky
1999-06-05  0:00           ` Robert Dewar
1999-06-07  0:00             ` Ada safety road Was: Which is right Vladimir Olensky
1999-06-06  0:00               ` Larry Kilgallen
1999-06-07  0:00                 ` Keith Thompson
1999-06-07  0:00                   ` Hyman Rosen
1999-06-08  0:00                     ` Robert A Duff
1999-06-08  0:00                       ` Keith Thompson
1999-06-09  0:00                         ` dennison
1999-06-09  0:00                           ` Entamology of "Nasal Demons" dennison
1999-06-09  0:00                         ` Ada safety road Was: Which is right Robert Dewar
1999-06-09  0:00                           ` Tucker Taft
1999-06-09  0:00                             ` Robert Dewar
1999-06-08  0:00                       ` Robert Dewar
1999-06-09  0:00                       ` dennison
1999-06-08  0:00                   ` Robert A Duff
1999-06-08  0:00                   ` Robert Dewar
1999-06-07  0:00                     ` Keith Thompson
1999-06-08  0:00                     ` Robert A Duff
1999-06-14  0:00                   ` Ada safety road Franco Mazzanti
1999-06-15  0:00                     ` Franco Mazzanti
1999-06-16  0:00                       ` Vladimir Olensky
1999-06-06  0:00               ` Ada safety road Was: Which is right Robert Dewar
1999-06-07  0:00                 ` Pascal F. Martin
1999-06-07  0:00                   ` Vladimir Olensky
1999-06-08  0:00                 ` Robert A Duff
1999-06-10  0:00               ` Peter Amey
1999-06-10  0:00                 ` Markus Kuhn
1999-06-11  0:00                   ` Vladimir Olensky
1999-06-12  0:00                     ` Robert Dewar
1999-06-12  0:00                       ` JP Thornley
1999-06-13  0:00                         ` Vladimir Olensky
1999-06-16  0:00                         ` William Dale
1999-06-19  0:00                           ` JP Thornley
1999-06-21  0:00                           ` Robert A Duff
1999-06-13  0:00                       ` Vladimir Olensky
1999-06-12  0:00                         ` Matthew Heaney
1999-06-13  0:00                           ` Vladimir Olensky
1999-06-13  0:00                         ` Robert Dewar
1999-06-13  0:00                           ` Vladimir Olensky
1999-06-13  0:00                         ` Robert Dewar
1999-06-13  0:00                           ` swhalen
1999-06-13  0:00                           ` Vladimir Olensky
1999-06-01  0:00   ` Which is right here - GNAT or OA ? Tucker Taft
1999-05-31  0:00 ` David Botton
1999-06-01  0:00   ` dennison
1999-06-03  0:00 ` Matthew Heaney
replies disabled

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