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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1cf653444208df72 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-09 22:15:28 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!netnews.com!xfer02.netnews.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!news.mindspring.net!not-for-mail From: Richard Riehle Newsgroups: comp.lang.ada Subject: Re: ada vs. cpp Date: Tue, 09 Oct 2001 22:18:02 -0700 Organization: AdaWorks Software Engineering Message-ID: <3BC3DA0A.267D4302@adaworks.com> References: <9pgr68$7pu1@news.cis.okstate.edu> <9phnic$9g5$1@nh.pace.co.uk> <5fkv7.134136$w7.19988807@news02.optonline.net> <9pmpk00a53@drn.newsguy.com> <9puvdc$225$1@nh.pace.co.uk> <9pv2f20jf4@drn.newsguy.com> Reply-To: richard@adaworks.com NNTP-Posting-Host: 9e.fc.c4.6d Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 10 Oct 2001 05:14:32 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:14112 Date: 2001-10-10T05:14:32+00:00 List-Id: "Robert*@" wrote: > can GNAT implement a pragma > > pragma LOOSE_MODE_START Such a pragma is not necessary. There are two main issues that annoy people who are accustomed to more loosely formed languages: the type model, and the visibility model. Both of these can be easily suppressed if one wishes to do so. The default for every Ada construct is "type safe." The default for visibility is "visibility safe." One may start with a language, such as Ada, in which the defaults are "safe" and relax those defaults through a variety of mechanisms. In fact, we can quite easily relax those defaults to the point that Ada becomes as precarious as standard C or C++. On the other hand, it is more difficult to start with a language where the defaults are "unsafe" and increase the safety. Such is the predicament of the C and C++ programmer. However diligently they may strive to improve the safety of their code, the underlying default, "unsafe", continues to bedevil them. Unfortunately, many of these attempts to make the code more safe produces exactly the opposite result. So, if you want unsafe Ada code, simply be liberal with use clauses, don't define new data types (use the types in package Standard), make everything a subtype of something else, use 'unchecked_access everywhere, along with lots of other tricks to make Ada more like C. Not very hard, actually. Stupid, yes. Difficult, no. Richard Riehle