Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well, a bit arbitrary, especially the choice of Self as the "ur-language" of object oriented programming.


I 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".


I thought the choice of Self was a bit strange too, but if you replace it with Smalltalk, the overall categories are pretty reasonable.


Yeah, I'd have to go with Simula/Simula 67 as the OO ur-language.


I'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.


My 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.


Self 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/

[2] https://bibliography.selflanguage.org/pics.html


Thanks for those links.


Simula 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.


Ii 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.


> 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.


> 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.


> 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 ). 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.


> Actually even ST-72 made synchronous calls

I've not suggested it is anything but synchronous, so I don't know why you're bringing that up. It's not what we're talking about when we talk about "message passing" in this context.

> 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 ).

Sure, you can implement method dispatch the same way. I've written a (partial; unfinished; very buggy) Ruby compiler that allows dynamic method redefinition with even basic C++-style vtables. The point is not the dispatch method but the ability to override them at will.

> 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

That late binding is an important part of it.

But you don't even need to deviate from static offsets to enable that late binding (you do need to do so if you want the ability to do dynamic interface-based inheritance, but even then you can use a vtable-like approach - see e.g. Protocol Extension: A Technique for Structuring Large Extensible Software-Systems, M. Franz, 1995 - which adds dynamic inheritance at runtime to Oberon) as long as the dictionaries/vtables/whatever you look them up in are mutable.


Which closes the loop to my point, that Simula 67 is much closer to the mainstream OO concepts we see in C++, Java, C# and Python than Smalltalk, and there is no reason to elevate Self (nor ST) as the "ur OO language".


Which I agreed with you is a reasonable stance. To quote myself:

> Ii 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.

I then went on to argue simply that because Smalltalk is at the root of a significant branch, I wouldn't have an issue with considering that an ur-language if one considers that branch important enough and/or consider message passing and late binding to be essential for a language to be object oriented, as opposed to having some object oriented features.

But I went on to again agree with you:

> 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.

To sum it up: I've argued that a reasonable case can be made either for Simula or Smalltalk depending on how you define OO, but that no well established definition of OO would make Self a reasonable candidate.


> prototypes instead of classes

Maybe the author picked that one as being in the lineage of JavaScript?


It is absolutely reasonable to group Self and Javascript together for that reasons, sure. I just don't think even that is sufficient reason to consider Self the "ur-language". If he'd created a separate category for prototype-base OO, Self would belong there, though.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: