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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: a new language, designed for safety ! Date: Thu, 05 Jun 2014 18:40:24 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <3bf7907b-2265-4314-a693-74792df531d1@googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls7.std.com 1402008015 17194 192.74.137.71 (5 Jun 2014 22:40:15 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 5 Jun 2014 22:40:15 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:GR2vFkLYM6Bi2S/+7hrhGC04+2U= Xref: news.eternal-september.org comp.lang.ada:20154 Date: 2014-06-05T18:40:24-04:00 List-Id: "Nasser M. Abbasi" writes: > On 6/4/2014 2:43 PM, Robert A Duff wrote: > >> But I wouldn't call it "unsafe" if you get a run-time error. > > This depends if the run-time error could have been avoided in > the first place had the compiler been able to detect the > problem at compile time or not? No, the meaning of "safe" and "unsafe" doesn't depend on that. > With these dynamics languages (Julia, swift, Matlab, etc...), > many errors will show up at run-time, since there is no > static time compiler with a rich language semantics that > allows the compiler to do more analysis and find more errors > even before the program is run. Quite true, but not relevant to my point about the word "unsafe". As I said, to me, "unsafe" (applied to programming language features) means "misuse of this feature can cause unpredictable behavior". Run-time errors are bad enough, but unpredictable behavior is far worse; it's useful to have a word to describe that distinction. > Even though some dynamic languages will not let one at run > time mix apples and oranges, and will give run-time error, > I'd rather know at compile time that I am not mixing apples > with oranges. That is much more safe. No, it is "better", perhaps, but not "safer". By my definition, "safe" and "unsafe" are absolutes; a feature either can or cannot cause unpredictable behavior. There's no "safer" and "less safe". >> To me, "unsafe" means "misuse can cause unpredictable behavior". >> Array indexing is safe in Ada (you get a run-time error if >> you go out of bounds), but unsafe in C (anything can happen >> if you go out of bounds). - Bob