🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #3584

Re: Dynamic typing (part 31,497)

#3584
From: Steve Olson
Date: Thu, 18 Apr 1991 07:16
48 lines
2985 bytes
In article <3086@opal.cs.tu-berlin.de> wg@opal.cs.tu-berlin.de (Wolfgang Grieskamp) writes:
   Since static or strong typing is a well established paradigm of software
   engineering I guess you are in the position to present some 
   arguments of evidence against it, arent you? Anyway, you did ...

Oops, not at all the same thing (didn't this come up a few weeks ago?).
In fact, most dynaically-typed languages (Lisp, Smalltalk) are strongly
typed.  Statically typed languages vary in the "strength" of thier typing.
I do not keep up with the software engineering literature, but I would venture
a guess that strong typing is the well established paradigm, and static
typing is, well, what we are arguing over ...

   You claim, that the errors caught by static typing are trivial ones.
   This is usally right. However, my experience is that most bugs of the
   kind you are searching for days over days are finally of trivial nature. 

Um, you're overloading the word "trivial".  Trivial as in "is not a
fundamental error in medium or large scale program design" and trivial as
in "easy to find".  In a typical dynamicaly-typed language, type errors
tend to be trivial in both senses of the word.  The trival (in the first
sense of the word) errors that cause me real problems are when I type "+"
when I meant "-", or I type "ymin" when I meant "xmin".  Static typing won't
help there.

Static typing will help catch errors in areas of the a program that are
not exercised well by test runs.  However I am dubious about the net positive
effect of this because todays typical statically-typed language requires
you to do bizzare things to get around the typing system - thus causing
type errors.  I spotted the following in the the copy of SunExpert that
showed up in my mailbox today (p 31) -

char *rv;
rv = mmap( ..... );
if ( rv == (char *)-1) {

Hmm, rv is either a pointer or a flag value ... and you tell 'em apart at
run time ... dynamic typing!  Except that you are an order of magnitude
more likely to make a hard-to-find error than something equivalent in a
dynamically typed language.  If mmap really returns 0 as its flag value,
then its say hello to Mr. mystery core dump.

   --
   Wolfgang Grieskamp 
   wg@opal.cs.tu-berlin.de tub!tubopal!wg wg%opal@DB0TUI11.BITNET

- Steve Olson
  MIT Lincoln Laboratory
  olson@juliet.ll.mit.edu
Technical Details
Message-ID: <OLSON.91Apr18021608@lear.juliet.ll.mit.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!rice!uw-beaver!mit-eddie!xn.ll.mit.edu!xn!olson
References: <2024@optima.cs.arizona.edu> <3086@opal.cs.tu-berlin.de>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!rice!uw-beaver!mit-eddie!xn.ll.mit.edu!xn!olson
From: olson@juliet.ll.mit.edu ( Steve Olson)
Newsgroups: comp.lang.misc
Subject: Re: Dynamic typing (part 31,497)
Message-ID: <OLSON.91Apr18021608@lear.juliet.ll.mit.edu>
Date: 18 Apr 91 07:16:07 GMT
References: <2024@optima.cs.arizona.edu> <3086@opal.cs.tu-berlin.de>
Sender: usenet@xn.ll.mit.edu
Followup-To: comp.lang.misc
Organization: M.I.T. Lincoln Lab - Group 43
Lines: 48
In-Reply-To: wg@opal.cs.tu-berlin.de's message of 17 Apr 91 15:52:31 GMT