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

Re: dynamic vs. static typing

On 2003-11-18T13:07:35-0800, Steve Dekorte wrote:
> On Nov 18, 2003, at 8:16 AM, Ken Shan wrote:
> >>How does "id" let you set the target of the generic proxy?
> >You can set the target using "const".
> Ok, let's make sure we understand one another. As I understand types, 
> in the context of pure OOP languages, the idea is to prevent "this 
> object does not respond to this message" errors. This is done by static 
> typing - putting labels on all the variables, arguments and return 
> values that indicate the list of methods to which the object referenced 
> or returned can respond to and doing a compile time check to ensure 
> that:
> 1. variables aren't sent messages which are not declared by their types
> 2. variables or arguments are not assigned to types which contain 
> methods which their declared types do not contain
> Does this sound reasonable so far?

It seems that under #2 you meant to say that "variables or arguments
are not assigned to types which contain methods which they [i.e., the
variables or arguments] do not respond to" -- is that right?

Assuming that, what you said seems reasonable to me.  Two caveats,
though.  First, I don't see any reason to distinguish between variables,
arguments, and return values.  I particularly don't see why your two
items above restrict themselves to "variables" and "variables or
arguments", respectively.

Second, you (and I) should keep in mind that I am trying to translate
(as were Pierce and Turner, not to elevate my email messages to the
level of their refereed publications) between your object-oriented
terminology and a vocabulary closer to languages like Haskell and System
F omega.  You noted earlier that you think your code is clear to someone
who has never seen Io; that is true only if you restrict yourself to
someone familiar with what you mean by "object", "message", "respond",
"pure OOP", etc.  Similarly, what I wrote is (I think) clear to someone
who has never seen (the particular concrete syntax I chose for) System F
omega or Haskell, if I restrict myself to someone familiar with (perhaps
even non-statically-typed) functional programming.  If you really want
to "make sure we understand one another", once again I refer you to the
same paper and its references, which undoubtedly do a much better job at
translation than I can.


Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig

Attachment: signature.asc
Description: Digital signature