4 ms·
Well, a bit arbitrary, especially the choice of Self as the "ur-language" of object oriented programming.
by Rochus 4y ago
Well, a bit arbitrary, especially the choice of Self as the "ur-language" of object oriented programming.
- iainmerrick 4y agoI thought the choice of Self was a bit strange too, but if you replace it with Smalltalk, the overall categories are pretty reasonable.
- cratermoon 4y agoYeah, I'd have to go with Simula/Simula 67 as the OO ur-language.
- vidarh 4y agoI'm ambivalent about that. As a technicality and inspiration it makes sense, but having learnt Simula (I studied in Oslo; it was the introductory language for many years) it does not give you the same focus on objects as Smalltalk does. But if you want to put another language than Smalltalk as the OO ur language, I'd certainly pick Simula over Self.
- Rochus 4y agoSimula 67 is much closer to the mainstream OO concepts we see in C++, Java, C# and Python than Smalltalk, or let alone Self. ST was the first dynamically typed OO language (scripting language actually) though.
- vidarh 4y agoIi is, because it inspired both the Smalltalk branch and the more mainstream OO languages, and hence it makes sense to consider it as a possible ur-language in that sense. Smalltalk is a branch, but it's an important enough branch introducing important enough new concepts that unlike with Self I wouldn't have an issue with people considering Smalltalk it's own ur-language, and because I agree with you that Simula at least on the surface will seem more familiar to people familiar with ALGOL-derived languages with OO mechanisms than to Smalltalk. Self, on the other hand, is less important for its concepts (ok, so it has prototypes instead of classes, but classes in Smalltalk are also objects, so I don't buy that it's that conceptually different, especially in a dynamic language where you can dynamically instantiate and mutate classes) than it is for the papers on its implementation.
- Rochus 4y ago> introducing important enough new concepts What do you have in mind, apart from duck typing? > considering Smalltalk it's own ur-language, and because I agree with you that Simula at least on the surface will seem more familiar to people familiar with ALGOL-derived For ST we have to differentiate the 72 and 74 from the 76 and later versions. Starting from 76 it has inheritance, compiled methods and virtual method dispatch quite similar to (though less efficient than) Simula 67.
- vidarh 4y ago> What do you have in mind, apart from duck typing? The focus on message passing and late binding combined. "Duck typing" is seriously diminishing it. You can write code that appears that way even in C++ with RTTI and inheriting from a shared root class and heavy use of virtual. But to achieve the equivalent of the combination of message passing and late binding in a language like C++ not built for it you typically end up having to build your own message dispatch machinery with no syntactic support to make it cleaner that will make your code look fundamentally un-idiomatic, and so doing so is tends to be limited to specific problems. It's this combination that makes Smalltalk-derived languages feel different. > For ST we have to differentiate the 72 and 74 from the 76 and later versions. Starting from 76 it has inheritance, compiled methods and virtual method dispatch quite similar to (though less efficient than) Simula 67. I'd argue when we say Smalltalk without qualifying it, most of us will be talking about Smalltalk-80.
- Rochus 4y ago> message passing and late binding combined. "Duck typing" is seriously diminishing it Actually even ST-72 made synchronous calls, but at least with a token stream interpreted by the receiving object (thus at least a bit of "message passing"). In ST-76 and later versions "message passing" is just nomenclature used by the ST folks for something that is just ordinary method dispatch and call (if you have doubts, you can analyze the innards of the ST-80 VM yourself e.g. with these tools: https://github.com/rochus-keller/Smalltalk https://github.com/rochus-keller/Smalltalk ). The major difference is the dispatch based on signature hash (similar to e.g. Java interface method calls) instead of static offsets, which enables late binding (at the expense of performance); and since everything including ordinary integers derive from Object, all values and objects are subject to dynamic method dispatch; it's no coincidence that Smalltalk was the first language to be associated with duck typing. The unification of scalar values and references, dynamic typing, and likewise the minimal syntax where control structures are implemented by means of runtime constructs were already known from Lisp; also closures (i.e. ST blocks) were already known before they were added to ST.
- cratermoon 4y agoMy knowledge of Simula is limited to reading about it and looking at small code samples, so I'm learning. But it's probably telling that I've learned more about Simula and seen Simula code but I've only ever heard about Self as a kind of footnote.
- vidarh 4y agoSelf is mostly important for its implementation and the papers about it, much more so than the language itself. If you're interested in compiler technology, especially the original papers by Urs Hölzle and David Ungar are very approachable. There's a very extensive bibliography here [1]. E.g. the paper on Polymorphic Inline Caches [2] by Urs Hölzle, Craig Chambers, and David Ungar was a seminal paper on optimising method dispatch for dynamic languages (note that lots of other work has been done since, but many of these papers are useful because they're short and simple and give a good foundation for digging into newer techniques) [1] https://bibliography.selflanguage.org/ https://bibliography.selflanguage.org/ [2] https://bibliography.selflanguage.org/pics.html https://bibliography.selflanguage.org/pics.html
- cratermoon 4y agoThanks for those links.
- vidarh 4y agoI had the same reaction. I think it stems from choosing an extremely strict set of characteristics. If you take the infamous Alan Kay quote [1], then e.g. Ruby fits in that category. But with the characteristics as-is, the category of OO languages as opposed to language that allow OO programming, is near empty and it becomes easier to "get away with" talking about the purity of Self rather than recognising that Smalltalk has a lot of spiritual descendants, while Self is the basis for a much smaller branch (Javascript being by far the most prominent spiritual descendant, but even JS is ruled out by the characteristics given). Ending up with Javascript and especially Ruby as ALGOL derived makes no sense to me. Where more limited OO languages have imported OO aspects, JS and Ruby have wrapped ALGOL syntax and a few concepts around semantics that are much closer to Self and Smalltalk respectively. [1] "OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme LateBinding of all things".