Remix.run Logo
aryehof 4 days ago

> Smalltalk's OOP is nothing like what existed either before or after, but since Alan Kay invented the term.

Rubbish. In terms of OO language constructs, Smalltalk is almost entirely derived from Simula. Let’s not revise history.

whstl 4 days ago | parent | next [-]

This is an oversimplification, and part of the problem I mention.

The "big leap" in Smalltalk was the idea that everything is an object and computation is message-passing, not just classes and instances. That’s not from Simula. Simula was more like an extension of Algol with OO bolted on. Smalltalk was a whole new conceptual model, which is not as simple to explain as Simula/C++/Java-style OOP.

user____name 3 days ago | parent | next [-]

Yup, in Smalltalk a method call (message) is explicitly ignored when the object class doesn't implement it. The VM image is persistent. The devil is in the details.

igouy 3 days ago | parent [-]

Not ignored!

  doesNotUnderstand: aMessage

  "Handle the fact that there was an attempt to send the given message to the receiver but the receiver does not understand this message (typically sent from the machine when a message is sent to the receiver and no method is defined for that selector).

  Raise the MessageNotUnderstood signal.  If it is caught, answer the result supplied by the exception handler.  If it is not caught, answer the result of resending the message within a guard for infinite recursion. This allows, for example, the programmer to implement the method and continue."
jibbit 4 days ago | parent | prev [-]

it is less of an oversimplification than 'nothing like what existed either before or after'

whstl 4 days ago | parent [-]

Clipping the quote like that completely changes the meaning of what I said. I didn't say that.

But I stand by what I actually said: Smalltalk's OOP is indeed very novel, even for today, especially compared to C++/Java, but it's also very different from Simula, especially the early Smalltalk versions.

It's not without lineage (Ruby and IO) or peers (Erlang), but it's still an incredibly different flavor of OOP than Simula. This is not a slight, this is a compliment to Alan Kay. But to compare it to C++ is to miss the mark. C++ is from a different branch of OOP.

mpweiher 4 days ago | parent | prev | next [-]

Hmm...have you looked at Smalltalk-72?

Now Alan makes it clear that the inspiration for Smalltalk OO came from Simula (and a bit from the Burroughs 220 and 5000, from Sketchpad etc.), but to say that Smalltalk is just that is a stretch at best.

The more direct line goes from Simula (Algol with classes) to C++ (C with classes).

to11mtm 4 days ago | parent | prev [-]

IDK I think it's still worth considering where certain languages 'got the right things right together' to be constructive...

That said as someone fairly unfamiliar with Smalltalk I'd like an example of what other parts of Smalltalk play well with it's OOP Sauce...

travisgriggs 4 days ago | parent [-]

For me, one of the examples was control flow. Smalltalk had none. Or, rather, it had one: send a message to an object/receiver. It was cool that ifTrue:ifFalse: was just a message you sent to a Boolean with a closure (or two) as an argument. And various iterations as well, so you could write your own. This you can do in Swift/Kotlin/etc as well of course. Where Snalltalk went next level was that closures were objects to. And you got them to run with messages like value/value:/value:value:, etc. In most languages with anon functions/closure, you just use argument list (i.e. parens) to invoke it. But you can’t send messages to the closure itself. Smalltalk had a host of introspection methods you could send to it, different flavors of evaluation, and of course any of the ones it inherited from Object. But where it got really cool (imo), was that you could add your own methods to BlockClosure. So you could implement all kinds of control messages on anonymous functions yourself. This was cool, it was all objects, all the way down. Where “object” meant things you can add behavior to, and send messages to.

arnsholt 4 days ago | parent [-]

To expand a bit on why this is cool: it lets you introduce new abstractions (for example wrapping some code in a database transaction or specialised exception handling) on an equal footing with the rest of the language, all without macros.