News for hackers. Stuff that matters.
Re:Can you recreate Objective-C in C? by saagarjha on Thursday August 09, 2018 @04:34PM (#17728222)
Your comment was killed very quickly, strangely, but I though it had valid content so I revived it. The actual issue against inlining is that anybody can intercept method calls, even from places that the compiler cannot know about such as bundles loaded at runtime. So this isn’t even an issue with Turing-completeness; it’s an impossible problem to solve at compile time.
Re:Can you recreate Objective-C in C? by chrisseaton on Thursday August 09, 2018 @05:13PM (#17728560)
> at compile time

That's the key thing - other languages which solve this solve it dynamically.

Re:Can you recreate Objective-C in C? by saagarjha on Thursday August 09, 2018 @05:20PM (#17728608)
Yeah, that’s what a JIT does. Unfortunately that’s not something that Apple really wants to open the door to on their platforms, especially for native code.
Re:Can you recreate Objective-C in C? by Someone on Friday August 10, 2018 @02:25AM (#17731133)
I don’t think that comes into play here. Objective-C is C, and although you could JIT any language, C isn’t made for it, both philosophically (one of its main claims to fame is ‘close to the metal’) and technically (a source file cold be compiled multiple times with different macro definitions or with a different set of #included files)
Re:Can you recreate Objective-C in C? by saagarjha on Friday August 10, 2018 @03:06AM (#17731259)
C isn't made for JIT because it's static; that's why inclining exists. Objective-C has room to improve because it has dynamic function calls.
Re:Can you recreate Objective-C in C? by chrisseaton on Friday August 10, 2018 @05:46AM (#17731912)
C can also benefit from inline caching - function pointers!