Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!agate!stanford.edu!leland.Stanford.EDU!leland.Stanford.EDU!craig From: craig@leland.Stanford.EDU (Craig Chambers) Newsgroups: comp.object Subject: Re: Run-time checks, Compile time Checks, and reliability Keywords: type checking, high reliability, fault tolerance Message-ID: <1991Apr7.013813.23513@leland.Stanford.EDU> Date: 7 Apr 91 01:38:13 GMT References: <1991Mar28.161307.6071@cbnewsh.att.com> <27F780E2.1872@tct.com> <1991Apr3.203332.25348@bony1.bony.com> Sender: news@leland.Stanford.EDU (Mr News) Organization: AIR, Stanford University Lines: 18 In article <1991Apr3.203332.25348@bony1.bony.com>, richieb@bony1.bony.com (Richard Bielak) writes: |> Another argument for static type checking is that it is more |> efficient, since many checks need only to be done once - at compile |> time - and not millions of times at run time. I disagree. In a non-object-oriented language, type information does provide significant help to the compiler, since types map one-to-one with implementations/representations. However, in a non-object-oriented language (at least one with a good type system), types specify interfaces (plus possibly some behavioral specifications) to objects, but specifically attempt to abstract away from specifying anything about implementations/ representations of the objects of particular types (to support more reusability of code). This means that such interface-level types provide little information for a compiler to use to optimize messages sent to such objects. So the standard argument that static type information speeds execution of programs does not apply to object-oriented languages (or at least does not apply to anything near the degree it does in non-object-oriented languages). -- Craig Chambers