**bpr:** _Lack of inheritance (and generics!) in Go was bemoaned by many, yet 
I'd say in terms of adoption it's been a success._

Go de facto _has_ inheritance via embedded types and delegation. The 
differences in semantics (such as lack of open recursion) are an annoyance, but 
can be worked around; it leads to a lot of copy-and-paste programming, but 
that's already common in Go. Parametric polymorphism (generics) is orthogonal 
to subtype polymorphism; dynamically typed OO languages do not have or need 
generics, plenty of statically OO languages historically didn't have generics 
(such as Simula 67). OOP does not mean "exactly like Java".

In any event, the bigger point is that you can mechanically replicate most 
things that you can do in (say) Python in Go.

**bpr:** _JS adopting classes came after it's success, and didn't drive its 
success at all._

Javascript had success because it had a monopoly on browser scripting, despite 
having horrible semantics in too many ways to count (such as `{} + [] == 0`).

**bpr:** _Clojure has never been "classically" OO at all._

Clojure is a fairly marginal language. A very well-designed one, but as far as 
adoption goes, it's not going to displace other languages anytime soon. And the 
adoption it has comes from the FP part of the crowd, where many also are 
involved in a religious war with OOP.

**bpr:** _OCaml, which I believe you are familiar with, has a very different 
sort of object system, and it's not widely used at all in the OCaml community; 
I bet they could drop the O and few users would care._

OCaml's object system is a very traditional one, with the exception that it 
supports structural subtyping (and that is only unusual for statically typed 
languages). That it is not widely used has two reasons: (1) the usual religious 
war between FP and OOP advocates and (2) inefficient method dispatch 
discourages its use.

And in the end, OCaml ended up with no less than six ways of doing runtime 
polymorphism, including two full-fledged and independent OO systems. These are: 
variant types, polymorphic variants, extensible variants, records of closures, 
objects, and first-class modules (first-class modules along with generative 
functors give you a completely separate OO subsystem).

Edit: to clarify something: I think in principle either multi-methods or vtrefs 
can be close enough with sufficient stdlib support. The biggest problem with 
methods is the uncertainty about their future and with vtrefs the fact that so 
far they only exist on paper.

Reply via email to