4 ms·
why?
by extension 15y ago
why?
- msbarnett 15y agoWhy what? Why is GCC obsolete for iOS/OS X dev? Because Apple will not be updating it in the future to track changes in the Objective-C language, runtime, and iOS and OS X platforms. Why won't Apple be updating it? Because they've indicated that they are not comfortable with contributing to projects based on the GPL, version 3, and they do not wish to be stuck forever on the last version of GCC released prior to that licensing change. Why is Clang the future? Because Apple has anointed it as compiler which will be receiving future updates to track changes in the Objective-C language, runtime, and iOS and OS X platforms. Why should any old projects that haven't already switched seriously consider doing so? Because the divergence between GCC and Clang is only going to increase with time, and code which doesn't make that transition now will face a much costlier transition down the road as new features become Clang-only and as it becomes increasingly impossible to run the old versions of Xcode which use GCC and for said old versions of GCC to build binaries which run on future versions of iOS and OS X.
- extension 15y agoOk, so it just needs to be done eventually, and there's no benefit per se to using Clang over GCC? I ask because I'm an iOS dev and I don't know anything about this issue. Why would the transition be much costlier later? More imperative I understand, but why more costly?
- msbarnett 15y agoIf you transition now, the incompatiblities for most apps are small to nonexistent. If, say, you transition 3 years from now when GCC can't build a working binary for a new iOS ABI version that the App Store rules require all new submissions support, and the syntax clang supports has diverged from what GCC was accepting, that's more time needed and dollars lost for every minute the porting takes you. But that's just a guess at the future. Clang/LLVM provides significant benefits today. Better error messages, better warnings, a seriously great static analyzer (given the constraints imposed by C's semantics), and Automated Reference Counting are just a few of them.
- eridius 15y agoOne would hope Clang isn't going to drop support for syntax that it supports today, because that would be a backwards-compatibility issue. However, I do agree that switching earlier rather than later is better. At the very least, the longer you put off the switch, the more code you'll have written that may need to be adjusted to work properly under Clang.
- seurahepo 15y agoApple does not want to support two sets of tools forever, it would not be cost effective. GCC is obsolete on Apple's platforms because Apple has chosen LLVM as the future basis of their tools. The reasoning was mostly technical, LLVM project also seems more nimble and aligned better with Apple's goals. Surely saner license did not hurt. LLVM has technical benefits compared to GCC, biggest being modularity, speed and memory usage come second. Modularity helps Apple make Xcode a better IDE. You can already see stuff in Xcode that would have been very hard to make with less modular toolset, as GCC. I expect it to pick up after the transition period is over. As an example they are using clang to parse the code for syntax highliting and code completion instead of a custom parser they used before. To use one codebase for parsing both in the IDE and compiler has inherent virtues. LLVM is also used by Apple in other products in addition to of Xcode. OpenGL runtime and OpenCL tools come to mind, efforts in LLVM project have good return on investment. Everyone, old or new projects should consider switching to clang, for speed and static analysis. Whether to use new objc features that require clang, is another question, in most cases it makes sense.