comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <krischik@users.sourceforge.net>
Subject: Re: Type safety on wikipedia
Date: Sat, 28 Jan 2006 07:44:31 +0100
Date: 2006-01-28T07:44:31+01:00	[thread overview]
Message-ID: <2229937.QtsCqM593F@linux1.krischik.com> (raw)
In-Reply-To: dreihb$712$1@pitr.home.jan

Jan Andres wrote:

> On 2006-01-27, Martin Krischik <krischik@users.sourceforge.net> wrote:
>> with Ada.Text_Io;
>>
>> procedure Access_Test is
>>     type Int_Access is access Integer;
>>     procedure Deallocate is new Unchecked_Deallocation ....
>>
>>    P : Int_Access := new Integer;
>>    Q : Int_Access := P;
>> begin
>>     Deallocate (P);
>>     Ada.Text_Io.Put_Line(Integer'Image(Q.All));
>>  end Access_Test;
> 
> Hmm, but aren't all the restrictions on the scope of access values
> actually there in order to guarantee type safety, as long as no unsafe
> constructs like 'Unchecked_Access are used? Or is
> Unchecked_Deallocation itself considered to be such an unsafe construct?
> If so, is there any "safe" alternative in Ada that we can use if we
> don't have GC?

No, there is no save alternative. There is a talk page where the authors of
the page discuss the page content and how to improve.

From there it becomes more and more clear that strictly type save language
might only be a special purpose language and that general purpose languages
can't be type save. A bit like original Pascal.

If you look at the page now: There is no list of type save languages - there
is a list of almost type save languages and there weak spots. Even
Standart-ML has a weak spot: interfacing with other languages.

Ok, there is SPARK. But for once SPARK is special purpose and hey, does
SPARK not allow interfacing with other non-type-save languages?

> Of course you could simply avoid such constructs as quoted above but
> the downside is that the language will not actually enforce this.

Indeed. For me this discussion means that I will renew my effort on garbage
collection in Ada. AdaCL was the next on the list for the gnuada
distribution anyway - now that ASIS has been added.

Martin
-- 
mailto://krischik@users.sourceforge.net
Ada programming at: http://ada.krischik.com



  reply	other threads:[~2006-01-28  6:44 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-26  7:28 Type safety on wikipedia Martin Krischik
2006-01-26 11:58 ` Alex R. Mosteo
2006-01-26 17:10   ` Martin Krischik
2006-01-26 20:24   ` Simon Wright
2006-01-26 20:43     ` Simon Wright
2006-01-27  6:58       ` Martin Krischik
2006-01-26 23:43   ` Bobby D. Bryant
2006-01-27 11:14     ` Alex R. Mosteo
2006-01-27 11:57       ` Martin Krischik
2006-01-27 15:30         ` Larry Kilgallen
2006-01-27 19:04           ` Martin Krischik
2006-01-27 22:06             ` Larry Kilgallen
2006-01-28  7:04               ` Martin Krischik
2006-01-29 21:48               ` Florian Weimer
2006-01-27 12:43       ` Georg Bauhaus
2006-01-26 13:49 ` Rod Chapman
2006-01-26 17:05   ` Martin Krischik
2006-01-26 18:14   ` Martin Krischik
2006-01-26 13:53 ` jimmaureenrogers
2006-01-26 15:18   ` Alex R. Mosteo
2006-01-26 16:49     ` Martin Krischik
2006-01-26 18:19       ` Alex R. Mosteo
2006-01-26 20:38         ` Simon Wright
2006-01-27 11:13           ` Alex R. Mosteo
2006-01-27 19:38             ` Simon Wright
2006-01-27 23:24               ` Randy Brukardt
2006-01-28  6:53               ` Martin Krischik
2006-01-27 18:58           ` Martin Krischik
2006-01-27 19:50             ` Simon Wright
2006-01-28  6:52               ` Martin Krischik
2006-01-26 19:22     ` Dmitry A. Kazakov
2006-01-26 19:07   ` Florian Weimer
2006-01-27  0:38     ` jimmaureenrogers
2006-01-27 18:54       ` Martin Krischik
2006-01-28  1:48         ` Jan Andres
2006-01-28  6:44           ` Martin Krischik [this message]
2006-01-31  2:13           ` Randy Brukardt
2006-02-06  5:02       ` Dave Thompson
2006-02-06  8:29         ` Larry Kilgallen
2006-01-27 11:34     ` Alex R. Mosteo
2006-01-27 12:18       ` Martin Krischik
2006-01-27 15:27       ` Florian Weimer
replies disabled

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