From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,80bc3e0698be468f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news4.google.com!news2.volia.net!solnet.ch!solnet.ch!news-zh.switch.ch!switch.ch!news.hispeed.ch!linux2.krischik.com!news From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Type safety on wikipedia Date: Sat, 28 Jan 2006 07:44:31 +0100 Organization: Cablecom Newsserver Message-ID: <2229937.QtsCqM593F@linux1.krischik.com> References: <1138260496.230283.147640@g43g2000cwa.googlegroups.com> <1138283608.433842.76060@z14g2000cwz.googlegroups.com> <87fynaajuh.fsf@mid.deneb.enyo.de> <1138322309.525464.253320@z14g2000cwz.googlegroups.com> <15595105.IY1iVEeMMt@linux1.krischik.com> NNTP-Posting-Host: 84-74-134-212.dclient.hispeed.ch Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.hispeed.ch 1138432503 21152 84.74.134.212 (28 Jan 2006 07:15:03 GMT) X-Complaints-To: news@hispeed.ch NNTP-Posting-Date: Sat, 28 Jan 2006 07:15:03 +0000 (UTC) User-Agent: KNode/0.10 Xref: g2news1.google.com comp.lang.ada:2695 Date: 2006-01-28T07:44:31+01:00 List-Id: Jan Andres wrote: > On 2006-01-27, Martin Krischik 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