Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!sdd.hp.com!mips!pacbell.com!ucsd!hub.ucsb.edu!eiffel!bertrand From: bertrand@eiffel.UUCP (Bertrand Meyer) Newsgroups: comp.object Subject: Re: Run-time checks, Compile time Checks, and reliability Keywords: type checking, high reliability, fault tolerance Message-ID: <524@eiffel.UUCP> Date: 7 Apr 91 17:16:59 GMT References: <1991Mar28.161307.6071@cbnewsh.att.com> <27F780E2.1872@tct.com> <1991Apr7.013813.23513@leland.Stanford.EDU> Organization: Interactive Software Engineering, Santa Barbara CA Lines: 39 From <1991Apr7.013813.23513@leland.Stanford.EDU> by craig@leland.Stanford.EDU (Craig Chambers): > 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). This runs contrary to our experience. To handle a routine call x.f with polymorphism on x and dynamic binding on f, it helps the compiler considerably to have the type information resulting from the declaration x: SOME_TYPE which indicates that the objects to which x may be attached at the time of the call are not arbitrary, but must be instances of SOME_TYPE (that is to say, direct instances of SOME_TYPE itself or of one of its descendants). By restricting the scope of possible types (classes), this information enables the compiler to handle calls in a much more efficient way than otherwise. -- Bertrand Meyer Interactive Software Engineering Inc., Santa Barbara bertrand@eiffel.uucp