3 ms·
As I remember, at the time Apple started Clang, GCC wasn't nearly as clean. The various stages (parsing, compiling, optimization, etc) were not cleanly separate
by MBCook 13y ago
As I remember, at the time Apple started Clang, GCC wasn't nearly as clean. The various stages (parsing, compiling, optimization, etc) were not cleanly separated/documented so using the compiler's parser for syntax highlighting wasn't really possible. GCC has improved quite a bit since Clang/LLVM showed up in many of these areas.
Even if GCC had very clean separation between the steps, the FSF's interpretation is that you couldn't use the GCC parser for something like highlighting/suggestions the way Apple does in XCode without making all of XCode GPL.
It's a perfectly fair interpretation. I think making the opposite case would be quite difficult. But it shouldn't be surprising that Apple wouldn't want to open up all of XCode. I also don't blame Apple for not wanting to continue to re-implement parts of GCC and try to stay bug-for-bug on parsing when the only reason you can't re-use the same code is licensing.
- __alexs 13y ago> Even if GCC had very clean separation between the steps, the FSF's interpretation is that you couldn't use the GCC parser for something like highlighting/suggestions the way Apple does in XCode without making all of XCode GPL. Only in this one technical implementation you've imagined. Interacting with GPLd tools via basically any method expect actually linking it into your code (e.g. pipes) doesn't infect your code with GPL obligations. Presumably just piping the entire code to gcc -fdump-tree-original every keystroke would be too slow but you could probably get it working nicely if you had the sort of engineer time Apple do.