5 ms·
Erlang/Elixir are two of the least OO languages I can think of. Point still taken though. Elixir is an absolute joy, and the more new languages take examples fr
by pkulak 6y ago
Erlang/Elixir are two of the least OO languages I can think of. Point still taken though. Elixir is an absolute joy, and the more new languages take examples from it, the better.
- andrewflnr 6y agoOn the contrary, at least if we talk about Alan Kay's vision then Erlang/Elixir are as close as we have today. Hint: the processes are objects.
- zokier 6y ago> at least if we talk about Alan Kay's vision Big if there. Most people do not mean Kays OO when they say OO.
- klibertp 6y agoWhich is why they should be educated, given a chance. No?
- xbar 6y agoI read "eradicated." But sure, let's educate them first.
- AnimalMuppet 6y agoKay was a visionary, but not every vision of his was the final word on reality. It's possible that the "mainstream" version of OO is better than Kay's.
- zokier 6y agoIt doesn't really matter if its better or worse. As a term OO means what people understand it to mean. Human languages (unlike programming ones) are descriptive, not prescriptive.
- dragonwriter 6y ago> As a term OO means what people understand it to mean. I would suggest that if you asked people to define the term, Kay’s definition would likely be the single most common (even after normalizing variations in wording). It would still only be a plurality, sure, but the remaining majority doesn't share a common understanding, either.
- klibertp 6y agoYes, though I believe knowing about him and his vision can be helpful in understanding the evolution of OOP and its current mainstream incarnations. Basically, "those who don't know history are doomed to repeat it", "history repeats itself as a farce", and all that... :)
- inopinatus 6y agoIt’s possible that I’m a teapot.
- weatherlight 6y agoIt’s possible that I’m a coconut.
- DonHopkins 6y agoIt's possible that weatherlight is a teapot and inopinatus is a coconut!
- inopinatus 6y agoYou can make a teapot from a coconut.
- astrange 6y agoThe mainstream version of OO is actually quite bad though. You can think of it as just being functions where the first parameter is to the left of the function name. It has a few more features than that of course, but all of these increase complexity and therefore bugs, and it doesn't have any features that reduce bugs. An example would be non-fragile ABIs (ObjC has this, C++ doesn't) or typestate/built in state machines (so you can't call methods if the object is in an invalid state for them). There's encapsulation at least, it's a start.
- thu2111 6y agoIt's pretty clearly not bad, given how many successful languages use it. Java, C#, C++, Kotlin. Windows, macOS, KDE, GNOME. They're all mainstream OO and for good reasons. Fragile ABI is basically a C++ problem. Java has had a stable OO ABI for 25 years now. The .NET ABI has gone through a few iterations, but is stable now. Of course Microsoft also had COM, which is/was a stable OO ABI accessible to many languages including C++ and was arguably just a subset of the C++ ABI without templates. In the AOT compiled work Swift now has a stable OO ABI (sort of). Rust is interested in getting one. Lack of a stable ABI is not an OO problem but more a problem of languages that are designed to compile ahead of time to native code and use native formats as their primary artifact format. Most features OO has reduce complexity and bugs, that's why people use them. There's no comparison between a clean OO API and the de-facto standard state before that, e.g. POSIX, Win32, Carbon.
- pjmlp 6y ago> Of course Microsoft also had COM, which is/was a stable OO ABI accessible to many languages including C++ and was arguably just a subset of the C++ ABI without templates. Why the past tense, when COM is the main way Windows APIs have been introduced since Windows Vista, as COM took over Longhorn OO ABI ideas? Nowadays we just call it WinRT.
- thu2111 6y agoRight, Microsoft don't talk about COM anymore. I haven't kept up much with Windows programming so lost track at some point of what their current-gen tech is and how it works. WinRT isn't just COM is it. It's custom languages, new app metadata formats and stuff. I don't see IUnknown in any modern Windows code samples.
- jghn 6y agoI agree w/ your sentiments here, but it is worth keeping in mind that Simula predates Smalltalk and could be viewed as both the first OO language and the progenitor of what became mainstream OOP.
- klibertp 6y agoYou're right. I'm constantly surprised how much of the history of programming I'm still missing, despite trying to learn as much as I can about it. The feature set of Algol blew my mind when I first learned about it, for example - and now I see I need to take a closer look at Simula, which was developed as a superset/extension of Algol. Learning about that is fascinating and really puts the "language wars" of today into perspective.
- jghn 6y agoBTW I saw you mention class oriented vs object oriented elsewhere and I do think that captures the difference pretty well, thus why I agreed with your sentiments. The actor model basically is object oriented programming in that context, whereas what most people mean winds up being class oriented. There's (at least) a third model IMO from CLOS & friends, such as Dylan, S4, and I'd argue Haskell Typeclasses. Not sure what I'd call it but it's the idea where you define data classes, generic functions, and then provide linkages between those data classes and the generic functions to give you methods on the state
- klibertp 6y agoYes, generic functions and multimethods are one solution to the expression problem, and they're pretty different from Smalltalk-like OOP. It's a shame they aren't more widely adopted - I think only Julia, Nim, and Clojure have them as a feature. Actually, if not for some historical accidents, we could have Dylan in place of Java today... I sometimes dream about such a world: functional core, CLOS-like generic functions and multimethods, sane multiple inheritance, syntax-case-like macros, native AOT compiler, sane module system... OpenDylan - the implementation I played with - is slow as molasses, but with even a tiny fraction of the work put into Java it could be made fast enough to rival C++. It's one of the most striking wasted chances in the history of programming.
- dragonwriter 6y agoNo, most people think of some ill-defined idea shaped largely by the concrete design of early versions of, and practice in, C++ and Java, reflecting a set of compromises between early OO visions (including, but not limited to, Kay’s), C’s particular style of statically-typed procedural programming, and various practices that emerged to deal with the warts of those compromises.
- klibertp 6y agoActually, Erlang and Elixir are one of the most OO languages out there. The original definition of OO, by Alan Kay, was to have a lot of miniature computers, with state and computation ability, called objects, which communicate by sending messages to each other. Yes, calling a method in Smalltalk or Self is called a "message send". Now, take a look at Erlangs processes - doesn't it all sound very similar? Edited to add: Kay also frequently says he's a proponent of object oriented, not class oriented programming. Classes are just a means of organizing the code, objects and their relationships is what matters. In that way, modules in Elixir are not inferior to classes in single-inheritance OO languages: they offer the same level of sharing and composing code (via macros, defoverridable, and defdelegate). Add to it protocols, which can extend arbitrary types (modules) and you get quite nice OO toolbox to use in Elixir.
- hyperpape 6y agoMy understanding is that Alan Kay cannot reasonably claim to have "the original definition of OO", only "a very good early definition". Additionally, it seems like he's either been a bit inconsistent or unclear about the essential ideas at different times. One source: https://hillelwayne.com/post/alan-kay/ https://hillelwayne.com/post/alan-kay/
- klibertp 6y agoGood read, thanks. I knew about Simula, but never analysed it deep enough to know how much of an effect it had on early Smalltalk. Still, the definition Kay gave as late as in 1998 resonates with me the most: OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. And this is almost exactly what Erlang implements: just add "asynchronous" before "messaging" and it fits perfectly.
- smt1 6y agoSimula(67) definitely was the original concept/implementation of OO. Smalltalk, C++, Java, etc all derived different aspects of it. - Main abstraction are classes (of objects). - Concept of self-initializing data/procedure objects Internal ("concrete") view of an object vs an external ("abstract") - Differentiated between object instances and the class - Class/subclass facility made it possible to define generalized object classes, which could be specialized by defining subclasses containing additional declared properties - Different subclasses could contain different virtual procedure declarations - Domain specific language dialects
- mbrodersen 6y agoErlang is more OO than any other so-called OO language out there.