From: Arthur Chance <{spamtrap}@...> Date: 2003-10-10T01:24:59+09:00 Subject: Re: von Rossum on Strong vs. Weak Typing Seth Kurtzberg writes: > On Friday 28 February 2003 10:25 am, Arthur Chance wrote: > > Seth Kurtzberg writes: > > > Very true. In my opinion adding Hindley-Milner typing to Ruby would > > > be a huge gain in reliability. > > > > As far as I understand it (which isn't that far), adding > > Hindley-Milner type inferencing to an OO language with super/sub-type > > relationships is at least difficult if not impossible. For a take on > > adding OO to a type inferenced language (SML) rather than adding type > > inferencing to an OO language take a look at the Moby site: > > http://moby.cs.uchicago.edu/ > > That makes no sense. If you can add super/subtyping to a type inferenced > language, then you can add type inference to a super/subtype language. If it > is impossible in one case it is also impossible in the other. I think I wasn't clear enough. You can have some type inferencing but you can't do full Hindley-Milner inferencing in OO systems. If you read the Moby papers you'll find they have abandoned H-M type inferencing and you have to declare the types of methods. Given those they can infer the types of the local variables in the method bodies. The paper _The design of a class mechanism for MOBY_ by Fisher and Reppy explicitly states: Another consequence of supporting subtyping is that ML-style type inference is not possible. -- 2, 3, 3 & 37: the Prime Factors of the Beast.