News for hackers. Stuff that matters.
Re:Steve Jobs, NeXTSTEP, and Early Object-Oriented Programming by astrange on Wednesday November 13, 2024 @09:40PM (#42132608)
The difference is NSInvocation. A function pointer doesn't capture the arguments to the function, but a message does.

Also, you can change the destination of a message send at runtime, but you can't change the destination of a function call unless you're dtrace and can do code patching.

Re:Steve Jobs, NeXTSTEP, and Early Object-Oriented Programming by em-bee on Wednesday November 13, 2024 @10:02PM (#42132712)
ok, so that means message passing needs a runtime, and it can be assumed that pretty much every language that has a runtime uses message passing. more evidence that it is message passing that won out.

and the profound enlightenment ( https://news.ycombinator.com/item?id=42130432 ) is not specific to message passing but about a dynamic language runtime. being able to intercept messages/function calls is just one of the benefits of that.

Re:Steve Jobs, NeXTSTEP, and Early Object-Oriented Programming by astrange on Thursday November 14, 2024 @01:24AM (#42133600)
Not sure if objc_msgSend is a runtime, but it does require malloc, so there are limits to how low level it can be.
Re:Steve Jobs, NeXTSTEP, and Early Object-Oriented Programming by mpweiher on Monday November 18, 2024 @02:49AM (#42170568)
> objc_msgSend [...] does require malloc,

Are you sure about that?

    ]pwd
    objc4/runtime/Messengers.subproj
    ]rg malloc
    ]
The two variants I implemented way back when also did not require malloc.

And of course NeXT used objc_msgSend() in the kernel, to good effect, so that's pretty low-level.