[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: the forward method [dynamic vs. static typing]



On 2003-12-09T19:18:35-0800, Tom Lord wrote:
>     > Static typing can make programs more concise: I can write
> No: type information can be used for that, which is not the same thing
> as ST.

Crucially, the type information that is used here is the argument and
return types of functions that have yet to be called (and in fact may
never be called).

> But, anyway, it wasn't _conciseness_ I attributed to DT but a unique
> (in some sense) minimalism of details -- avoidence of having to
> provide redundant information.  How much do you have to say about a
> program in order to execute it correctly?  ST languages require you to
> say more than that.

I provided an example case where, unless something (such as a static
type system) reasons about what functions that have yet to be called
(and in fact may never be called) expect and return, the programmer
would need to say more than is necessary for a program to execute
correctly.  Why do I have to both tell a function what to return when
it is perfectly clear what the next function in the pipeline expects
as input?  Reasoning about the types of functions before they are ever
invoked allows me to eliminate this redundancy of expression.

> That you can compress the source text of a program by using something
> that puns as a part of an overall system of type declarations is
> interesting, but not contradictory to my point.

Again, the "pun" I gave as an example relies on being able to reason
about the types of functions before they are invoked.  Assertions do not
let me express such reasoning.  (Neither do logic variables, by the way,
in the presence of side effects that cannot be undone by backtracking.)

-- 
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
International Human Rights Day * 2003-12-10 * http://www.un.org/rights/

What if All Chemists Went on Strike? (science fiction)
http://www.iupac.org/publications/ci/2003/2506/iw3_letters.html

Attachment: signature.asc
Description: Digital signature