[TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

Greg Morrisett greg at eecs.harvard.edu
Fri Apr 19 09:34:09 EDT 2013


> William Cook's Onward 2009 essay makes an argument, which is convincing
> to me and to many others in the OO community, that the distinguishing
> characteristic of objects is dynamic dispatch (a.k.a. subtype
> polymorphism).

I fail to see what dynamic dispatch has to do with subtype
polymorphism.  They are completely orthogonal.  (And even
dynamic dispatch is an abused term.)  Objects are a degenerate
case of first-class modules (ADTs in Uday's terms.)  It's
true that it's natural to couple this with sub-type polymorphism.
But it's also natural to couple this (a la OCaml's object system)
with e.g., row polymorphism.

I do agree that the abstraction mechanisms used have little
or nothing to do with state and identity, which is also
typically confused with the whole "OO" mantra.  It's perfectly
reasonable to do value-oriented programming with first
class ADTs.  Happens in both Haskell and OCaml all the time.

-Greg


More information about the Types-list mailing list