News for hackers. Stuff that matters.
Re:Mulle-objc: A New Objective-C Compiler and Runtime by DHowett on Saturday November 26, 2016 @05:52PM (#13046443)
I couldn't find documentation that supports Clang offering the __builtin_apply intrinsics, but their availability would make a C objc_msgSend somewhat more palatable.
Re:Mulle-objc: A New Objective-C Compiler and Runtime by groovy2shoes on Saturday November 26, 2016 @06:10PM (#13046548)
Ah. I don't mean to be too argumentative. You've helped me to understand why objc_msgSend() could not be done in standard C, and I thank you for that :)

However, in the case of GCC's ObjC implementation, I don't see why it couldn't be implemented in GCC's dialect, thus obviating any need for assembly.

Pardon me while I reflect on (and lament) the fact that we're still stuck using such crude and ancient tools for systems programming...

Re:Mulle-objc: A New Objective-C Compiler and Runtime by lilyball on Monday November 28, 2016 @03:48PM (#13058281)
FWIW, it appears that Mulle-objc gets around this by actually changing the calling convention for Obj-C methods, so the IMP takes a single parameter (beyond self and _cmd) which is a struct that contains all of the method parameters. This way the compiler can just synthesize the struct for you, and then objc_msgSend() itself can be written in C because it just needs to pass the pointer to the struct along to the IMP rather than messing about with forwarding arbitrary arguments.
Re:Mulle-objc: A New Objective-C Compiler and Runtime by groovy2shoes on Wednesday November 30, 2016 @11:45PM (#13077242)
Interesting. Thanks!