Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!ee.udel.edu From: new@ee.udel.edu (Darren New) Newsgroups: comp.lang.misc Subject: Re: Dynamic typing (part 3) Message-ID: <50085@nigel.ee.udel.edu> Date: 8 Apr 91 19:32:12 GMT References: <28924@dime.cs.umass.edu> <6APR91.10183202@uc780.umd.edu> <6APR91.10374005@uc780.umd.edu> Sender: usenet@ee.udel.edu Organization: University of Delaware Lines: 37 Nntp-Posting-Host: snow-white.ee.udel.edu In article <6APR91.10374005@uc780.umd.edu> cs450a03@uc780.umd.edu writes: >I wrote (paraphrasing Darren New) >>"Dynamic typing is when the type of a variable _may_ be unknown at >>compile time." Actually, unless you are talking about type inferencing, I would say "*must* be unknown." If the type is known at compile time, it is static typing, period. If you don't specify the type but the compiler can figure it out for you, then that is static typing, because the type of the values assigned to the variable is known statically. I never intended to imply that dynamic typing and static typing cannot be mixed in the same language. >An even yet more exactly stated version would be :-) >"Dynamic typing is when the most efficient of the available primitive >machine representation for some value(s) is chosen at run-time." I don't think it has anything to do with machine representations or efficiency. Your definition would exclude Objective-C, Smalltalk, C++, and every other dynamically typed language I know except APL. For example, Smalltalk does not chose the most efficient version of the data: it uses what the programmer defines. Maybe languages like Mathematica or ML do such a thing, but chosing an efficient representation is orthagonal to dynamic typing. For example, in Ada (as I understand it), one can say "I need a float with this range and that accuracy at least" and the compiler will chose the most efficient representation. In Smalltalk, one must define all the operations on lists. Ada choses efficient reps but is statically typed, and Smalltalk does not chose efficient reps but is dynamically typed. -- Darren -- --- Darren New --- Grad Student --- CIS --- Univ. of Delaware --- ----- Network Protocols, Graphics, Programming Languages, FDTs ----- +=+=+ My time is very valuable, but unfortunately only to me +=+=+ + When you drive screws with a hammer, screwdrivers are unrecognisable +