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

> I’m a rubyist, but how is message passing fundamentally different from method calling?

The difference is fairly subtle most of the time in practice, which is why dynamic OO languages like Ruby that use message passing can mostly look like OO languages that use method calling, though it is significant behind the scenes and opens up a lot of possibilities; one of the more obvious practical differences is that it is why Ruby can capture and handle unknown "method calls" via "method_missing", which works the way it does because the version of __send__ defined in BasicObject looks for an existing method matching its first argument in the object's inheritance chain, and if it finds that calls it, and if it doesn't find one does the same thing with the "method_missing" method.

There's a lot that can be built on top of this, either leveraging method_missing or more directly.

Though I think the more relevant issue upthread isn't message passing vs method calling but narrow vs broad conception of nouns/agents.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: