Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uwm.edu!bionet!alc!chang From: chang@alc.com (Sehyo Chang) Newsgroups: comp.object Subject: Re: CHALLENGE: typing and reusability (was: Re: blip) Message-ID: <1058@denver.alc.com> Date: 28 Mar 91 17:35:11 GMT References: <1991Mar26.005805.1914@kodak.kodak.com> <1991Mar27.040253.17343@leland.Stanford.EDU> Organization: Ascent Logic Corporation; San Jose, CA Lines: 66 In article jls@rutabaga.Rational.COM (Jim Showalter) writes: >>Sure, type errors would result in a statically-typed language, and >>run-time errors in a dynamically-typed language. There's no problem >>with that: > >Uh, yes there is. The Achilles Heel of dynamically-typed languages is >run-time errors. These may be fine for WIMPS interfaces on workstations: >just print out "Window Manager is confused", abort, and let the user >reboot the system. ;-) > >This gets a little trickier when the code is running embedded in a >$100 million satellite orbiting Venus. >-- >***** DISCLAIMER: The opinions expressed herein are my own, except in > the realm of software engineering, in which case I've borrowed > them from incredibly smart people. You mean I never gets program crash If I write program in C,C++,Fortran,Ada? The core dump I got yesterday when my simple 'C' program crashed is total illusion? This is most illogical, crude, stupid and absurd statement I seen for long time. Boy I sure hope I don't use any software written by your company(or relying on software just because it is written in static-type language) Given any language/environment you will have possibility of generating error which was not forceen. In case of dynamic-type languages, it could be MNU(Message Not Understood) or variants; In static-typed languages, it could be pointer zapping(which is more catastrophic) or run-away recursion(which eats all available memory, have you seen Unix when all swap-swap is gone?, it is not pretty!), or end-less loop creating infinite processes?. In fact number of possible error in static-typed language is greater than number of errors possible with dynamic-typed interface. PROOF: Since size of program is finite, number of possible mismatch E(Dynamic-typed) = finite For static-typed language number of ways programs you can write is infinite and thus generate infinite errors(since due to 'halting program 'theorem', it is not possible to predict when program will stop). Thus E(Static-typed) = infinite This will compute ratio of dynamic-typed errors to static-typed errors E(Dynamic-typed) / E(Static-Typed) = finite/infinite = R Since we all know from highschool math anything divide by inifite is zero, thus R = 0 , Q.E.D. This concludes proof that errors result from dynamic-typed language is harmless since they cany only do 'limited' amount of damage!. Life is too short, let's figure out best tool for given problem. Instead of fighting stupid religious wars. -- Sehyo Chang chang@alc.com Ascent Logic Corp (408)943-0630 180 Rose Orchard Way, Suite 200 San Jose, CA 95134