Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!deccrl!news.crl.dec.com!nntpd.lkg.dec.com!tkou02.enet.dec.com!jit533!diamond From: diamond@jit533.swstokyo.dec.com (Norman Diamond) Newsgroups: comp.lang.misc Subject: Re: Run-time Type Errors in Smalltalk Message-ID: <1991May9.023313.28308@tkou02.enet.dec.com> Date: 9 May 91 02:33:13 GMT References: <3865@ssc-bee.ssc-vax.UUCP> <530@eiffel.UUCP> <1991Apr28.022234.287@odi.com> <2604@calmasd.Prime.COM> Sender: usenet@tkou02.enet.dec.com (USENET News System) Reply-To: diamond@jit533.enet@tkou02.enet.dec.com (Norman Diamond) Organization: Digital Equipment Corporation Japan , Tokyo Lines: 37 In article rockwell@socrates.umd.edu (Raul Rockwell) writes: >Chuck Peterson: >> Perhaps statically typed languages should be used like assembly >> language, where the added security (as with performance for >> assembly) justifies recoding. (Perhaps both security and >> performance in some measure.) >Perhaps I'm missing some fundamental insight, but I fail to see how >static typing provides any sort of security. >Consider an arbitrary program, with (for example) several thousand >variables and a few dozen types. If the program says: f(x), >what does static typing buy you, security-wise? You can only >misidentify x a few hundred ways instead of a few thousand? (Awesome >reliability there). Exactly. In this scenario, if you misidentify x, there is a 90% chance that your error will be caught. This is 9 times as valuable as a case previously discussed, where other fields of engineering value a 10% improvement in safety. >Unless you are intending to allow only one instance of a type in any >lexical name-space? That would be security! [And you'd be writing >your program at least twice, once in "type expressions", and once in >"imperative expressions". There's nothing quite like trying to keep >two versions of the same thing in sync to improve reliability...] Although excessive and rhetorical, this also has its value. Why did businesses used to use "verifiers" on their punched cards for data entry? Why do fault-tolerant machines compute many results twice? You'd better believe there is nothing like redundancy to improve reliability. When mismatches are detected (which can benefit greatly from mechanical assistance or compilers), they can be inspected manually to see if they are really errors, or which part has the errors. This is far better than skipping half of them and letting 10% or 90% of the other half remain undetected. -- Norman Diamond diamond@tkov50.enet.dec.com If this were the company's opinion, I wouldn't be allowed to post it.