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,703c4f68db81387d X-Google-Thread: 109fba,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!z14g2000cwz.googlegroups.com!not-for-mail From: "Jerry Coffin" Newsgroups: comp.lang.ada,comp.lang.c++,comp.realtime,comp.software-eng Subject: Re: Teaching new tricks to an old dog (C++ -->Ada) Date: 8 Mar 2005 07:29:47 -0800 Organization: http://groups.google.com Message-ID: <1110295787.614050.193480@z14g2000cwz.googlegroups.com> References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <87is4598pm.fsf@insalien.org> <1110054476.533590@athnrd02> <1110059861.560004@athnrd02> <87wtsl7jts.fsf@insalien.org> <1110264816.858853.54020@l41g2000cwc.googlegroups.com> <1110273670.682581@athnrd02> NNTP-Posting-Host: 70.33.25.135 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1110295792 11932 127.0.0.1 (8 Mar 2005 15:29:52 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 8 Mar 2005 15:29:52 +0000 (UTC) User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: z14g2000cwz.googlegroups.com; posting-host=70.33.25.135; posting-account=mZiOqwwAAAC5YZsJDHJLeReHGPXV5ENp Xref: g2news1.google.com comp.lang.ada:8860 comp.lang.c++:44606 comp.realtime:1065 comp.software-eng:4618 Date: 2005-03-08T07:29:47-08:00 List-Id: Ioannis Vranos wrote: [ ... ] > > unsigned char *a = reinterpret_cast(&x); > > unsigned char *a = reinterpret_cast(&x); Oops -- quite right. Fortunately, despite it's reputed lack of safety, any properly-functioning C++ compiler would have caught my mistake had it been in real code. [ ... ] > Also since Ada is more ancient than C++ in terms of a final standard, > we can expect that some things are "more ancient", but it is still > an interesting language since it can do low level stuff. I'm not sure "ancient" applies to either -- at least the last time I noticed, the most recent Ada standard was approved in 1995, which is marginally older than the C++ standard. I'm not really sure this means a lot though -- most of the basic ideas of C++ were fixed by then in any case. Certainly there were changes in the text of the rules after that point, but most of these were to get the rules to require what had already been decided upon, not things that were intended to change the language. > I am not sure it is "safer" than C++ too, I am suspicious of "safe" > languages. The first problem is to define what you mean by safety. Bjarne has been fairly explicit that most safety features in C++ are intended to prevent accidents, not intentional subversion. It's always seemed to me that Ada has had a rather muddled idea of the "threat model", so the language features have never been entirely aligned to a single intent. Some parts appear intended to prevent accidents, but are quite easy to subvert when one wishes to do so. Other parts appear to have been designed with the intent of preventing even intentional subversion, but fail to do so, and simply render some things quite a bit uglier than there seems to be good reason for. In fairness, I should add that my personal experiece with Ada was almost entirely with the 1983 version, so it's entirely possible that at least some of these have been fixed -- OTOH, looking at the code snippets posted to this thread, it looks like at least some of the ugliness remains. -- Later, Jerry. The universe is a figment of its own imagination.