logoalt Hacker News

flohofwoeyesterday at 4:55 PM1 replyview on HN

In the end though most of those 'sending a message' actions are just fancy virtual method calls (e.g. an indirect jump), everything else would be much too slow:

https://www.mikeash.com/pyblog/friday-qa-2017-06-30-dissecti...

IMHO the whole 'message' and 'sending' lingo should be abandondend, the job of objc_msgSend is to look up a function pointer by certain rules. There are no 'messages' involved, and nothing is 'sent'.


Replies

9rxyesterday at 5:00 PM

> There are no 'messages' involved, and nothing is 'sent'.

The conceptual difference is significant as an object can respond to messages that it doesn't have a method for. You are, conceptually, just sending a message and leave it up to the object what it wants to do with it (e.g. forwardInvocation:). That is, after all, what sets "object-oriented" apart from having objects alone. Optimizations that can be made under the hood don't really affect the language itself.

show 2 replies