4 ms·
There’s no inlining, because determining whether inlining wpuld be safe is probably Turing-complete. However, IMP cacheing is a thing and that’s enough for most
by machiavelli1024 8y ago
There’s no inlining, because determining whether inlining wpuld be safe is probably Turing-complete. However, IMP cacheing is a thing and that’s enough for most cases. For the rest there is C and (Objective-)C++.
- saagarjha 8y agoYour 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.
- chrisseaton 8y ago> at compile time That's the key thing - other languages which solve this solve it dynamically.
- saagarjha 8y agoYeah, 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.
- Someone 8y agoI 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)
- saagarjha 8y agoC 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.
- chrisseaton 8y agoC can also benefit from inline caching - function pointers!
- cestith 8y agoDid you mean to say "NP-Complete" where you said "Turing-complete"?