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

Messaging is more general.

A message can be asynchronous. It can also be synchronous. You can persist messages, replicate them. Distribute them.

With a method call, the "caller" control what code gets executed. With a message-send, the sender politely asks the receiver to respond to the message. Is there code executed? Maybe. Maybe not. Maybe the message is ignored.

So something like Smalltalk is (roughly) at the minimal end for the capabilities of "messaging" whereas it is either at or slightly beyond the maximal end for "calling a method". The fact that there is a slight overlap makes things difficult, but not impossible, to distinguish.

In the articles on Software-ICs[1], they call the flavour of OO "object/message"

"Sending a message to an object is exactly like calling a function to operate on a data structure, with one crucial difference: Function calls specify not what should be accomplished but how. The function name identifies specific code to be executed. Messages, by contrast specify what you want an object to do and leave it up to the object to decide how."

I am not sure I'd agree with that 100%, and there are tons of ways to argue against it, but I think it's a start.

[1] https://blog.metaobject.com/2019/03/software-ics-binary-comp...



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

Search: