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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public From: Eric Clayberg Subject: Re: Static vs. Dynamic typing again (was Re: OO, C++, and something much better!) Date: 1997/01/23 Message-ID: <32E7E08A.3079@parcplace.com>#1/1 X-Deja-AN: 211795513 references: <32DF458F.4D5C@concentric.net> <32DF94DC.6FF8@watson.ibm.com> <32DFD972.37E4@concentric.net> <32E4FC5B.242C@watson.ibm.com> <32E6862D.608B@parcplace.com> <32E764D0.23D9@calfp.com> <32E7A686.56D@parcplace.com> <32E7BD57.2558@calfp.com> content-type: text/plain; charset=us-ascii organization: ParcPlace-Digitalk, Inc. mime-version: 1.0 reply-to: clayberg@parcplace.com newsgroups: comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object x-mailer: Mozilla 3.0 (Win95; U) Date: 1997-01-23T00:00:00+00:00 List-Id: Richie Bielak wrote: > What also wanted to say in my previous post is that static typing > proves that there is no call in the program that will cause > the "message not understood" error. So a static type check can prove that a message wont be sent to an object whose memory has been freed up prematurely, huh? I don't think so. A static type check would certainly catch *some* "message not understood" problems (in particular, those that corresponded to actual type errors), but by no means all or even most of them. Most "message not understood" errors are caused by messages being sent to nil (e.g., an uninitialized variable or a prematurely freed variable). Furthermore, the static type checker would not be able to detect errors that were caused by dynamic message creation and dispatch (e.g., the message selector is constructed dynamically based on runtime data). > Is the chance of this kind of error "absurdly low"? For "message not understood" errors that correspond to actual type errors, yes. Static type checkers have been developed for Smalltalk (e.g., the StrongTalk system). They have not been commercially successful so far. Although they work fine, they are attempting to solve a problem that in practice isn't really a problem. Smalltalk has been around for a long time. Techniques for adding static type checking to it have been available for a long time. If static typing had ever become an important issue for the Smalltalk community, the Smalltalk vendors (IBM included) would have provided that capability. It hasn't, so they haven't. -Eric