5 ms·
I do this for a game library I'm writing. The problem is, if Python is a language with batteries included, then on non-Apple platforms Objective-C only comes i
by bitwize 14y ago
I do this for a game library I'm writing.
The problem is, if Python is a language with batteries included, then on non-Apple platforms Objective-C only comes in kit form -- with certain critical components you have to supply yourself. To wit: due to changes made in the Objective-C runtime made by Apple and backported to the GNU runtime (which, mirabile dictu, is now MUCH more API-compatible with Apple's stuff), the Object class is now only the barest skeleton of a thing, and no longer has +alloc, -init and -free methods in its own right. To get even constructors and destructors without the Cocoa framework, you will have to implement them yourself. Not that hard to do, actually; there are API calls for that. But the average developer is going to wonder what sort of bush league he's operating in where the language runtime doesn't even provide constructors and destructors.
As a rule if you are going to use Objective-C, you are committed to Apple.
- comex 14y agoWell, sort of. GNUstep provides a free implementation of (enough of) Cocoa.
- nglevin 14y agoGNUstep-base is pretty solid if you're looking for an open source Foundation (constructors, destructors, container classes, networking, etc.) that's compatible with Apple's implementation. If all you're looking for is constructors and destructors, consider ObjFW. https://github.com/Midar/objfw/ https://github.com/Midar/objfw/ ObjFW is much more lightweight, although it does have its own set of conventions. Fortunately, +alloc, -init, +new and -dealloc are all present and accounted for.
- deleted 14y ago[deleted]
- mpweiher 14y agoWhile there is certainly some truth to what you say, why do you tie your assessment to the Object class? Object has been on its way out for well over a decade now, and all the alternative toolkits like GNUStep and Cocotron have good support for NSObject and friends.