FreeBSD 10 To Use Clang Compiler, Deprecate GCC
An anonymous reader writes "Shared in last quarter's FreeBSD status report are developer plans to have LLVM/Clang become the default compiler and to deprecate GCC. Clang can now build most packages and suit well for their BSD needs. They also plan to have a full BSD-licensed C++11 stack in FreeBSD 10."
Says the article, too: "Some vendors have also been playing around with the idea of using Clang to build the Linux kernel (it's possible to do with certain kernel configurations, patches, and other headaches)."
What's wrong with GCC?
I've heard positive and negative claims regarding this. Certainly, Apple thinks it's production-ready (I think it was Xcode 4.2 that they stopped shipping GCC). Do you have a link showing that generated code is significantly worse? Which versions were compared?
One of the FreeBSD developers gave a talk about this. FreeBSD has commercial users, and the new GCC just wouldn't have been an option for them. The older license-compatible version still in FreeBSD wasn't receiving updates, and it was beginning to affect developers too greatly.
Whether this compiler switch is a good thing or not depends on how much you hate the idea of commercial vendors using open source. GCC's strictness is admiral from an ideological perspective, but certainly not from a practical one. It should be noted that even Linus Torvalds adheres to a more pragmatic worldview:
There are "extremists" in the free software world, but that's one major reason why I don't call what I do "free software" any more. I don't want to be associated with the people for whom it's about exclusion and hatred.
It's pretty damning when Linus himself no longer refers to Linux as free software because he doesn't like the extremism of the free software movement. And why should he? He's an engineer, not a religious fundamentalist.
Stallman and others deliberately fought having APIs, proper documentation and to allow plugins for all parts of the GCC toolchain, to keep control of the thing.
Stallman and others deliberately fought having APIs, proper documentation and to allow plugins for all parts of the GCC toolchain, to keep control of the thing.
Mostly result of dispute with DEC SRC when GCC and parent FSF failed to enforce GPL on Modula-3. Moving target known as GCC internals has been problem ever since, mostly to "legitimate" GNU compiler developers.
LLVM, on the other hand, made ingenious move with standard and open IR. Overall modular design is another boon.
GCC was in blind alleys before. No real reason for them not to survive this one. Another EGC can happen, to pull GCC in future.
http://opencm3.net, http://www.nongnu.org/gm2/
... Which is hilarious because it is the BSD fundamentalists who are re-implementing huge projects just to avoid a license they don't like for no reason other than political correctness ...
Untrue. Gcc is handicapped by political decisions in it technical design. It intentionally does not allow "others" to plug into some "internals". "Internals" that would facilitate other tool builders, especially those creating a graphical integrated development environment.
LLVM/Clang doesn't come with such technical baggage. Its modular rather than monolithic. It is a newer code base that is far easier to work with, even gcc devs moan about the bloat/complexity of their code base. Nearly all long lived project reach a point where it is better to toss the legacy code out and start from scratch, gcc may have very well surpassed that point.
And on some platforms LLVM/Clang simply generates better code.
Which is hilarious because it is the BSD fundamentalists who are re-implementing huge projects just to avoid a license they don't like for no reason other than poltical correctness.
Clang also addresses the lack of modularity in GCC. One of Apple's Clang engineers gave a talk several years ago about how at NeXTStep in the early 90s, he asked Stallman to implement precompiled headers in GCC. Stallman refused on political grounds. GCC was also intentionally obfuscated to make it difficult to integrate with. It's a clear example of rigid religious ideology standing in the way of and given prominence over technological progress.
whereas now people are moving to BSD-style licenses with no such benefits.
This is symptomatic of PHB/MBA thinking: short term gains/benefits that mortgage long term growth.
In a couple of years time, there will be a proliferation of different, incompatible versions of CLang/LLVM that will be increasingly expensive to maintain. Furthermore, I can foresee vendors making incompatible changes to the code produced by CLang, subtle ABI breakage and the like. The upper levels will suffer too : vendor A's version will not be able to compile source code with vendor B's extensions and vice versa.
Then in come the patents, and to compile certain code on a certain platform (OS version and hardware) you'll need vendor C's compiler with some new super-duper patented feature that no one else is allowed to implement.
This sounds like the 1980s/ealy 1990s all over again. Unix wars, balkanisation, and one dominant vedor ... Microsoft, although this time it'll be google.
Stick Men
In a couple of years time, there will be a proliferation of different, incompatible versions of CLang/LLVM that will be increasingly expensive to maintain. Furthermore, I can foresee vendors making incompatible changes to the code produced by CLang, subtle ABI breakage and the like. The upper levels will suffer too : vendor A's version will not be able to compile source code with vendor B's extensions and vice versa.
Hindsight is invariably more accurate than foresight. And in this case, hindsight tells us that there are plenty of non-GPL free packages that you use every day that haven't succumbed to either of your fears. In fact you use at least a couple of them when you read this.
This sounds like the 1980s/ealy 1990s all over again
That wouldn't be bad. The productivity per user has never been higher, and most of what we use now was invented then. I'd rather see that again that these modern days where ideas are scarce and productivity per user base at an all time low.
GCC doesn't need GPL, a freeware license would suffice.
Over the years I've read and analyzed the sources and consistently found the source to be as readable as the binary code, regardless of platform.
Compiler developer forums seem to confirm my findings with frequent comments and insults on GCC like:
Nonetheless, I praise the omnipotence of GCC, as long as I'm not the first guy on a new platform.
At the moment I write this there are 297 comments mostly debating the merits of LLVM/Clang vs. GCC. There is not one mention of EGCS.
Fifteen years ago GCC was forked. A group of people we're frustrated with GCC and its leadership because they had contributions to make and talent to offer that was not welcome. They called their fork EGCS.
Why are we doing this? It's become increasingly clear in the course of hacking events that the FSF's needs for gcc2 are at odds with the objectives of many in the community who have done lots of hacking and improvment [sic] over the years.
The GCC you use today is EGCS. A few years later EGCS was adopted as GCC 2.95 after the merits of EGCS became undeniable.
Looks like we've come full circle. The cool kids are off in the weeds making cool stuff. Better stuff, and the `Powers That Be' are not interested. The `needs' of the FSF today are no longer in sync with the `needs' of the developers of today.
The bottom line is that GCC as it is with it's leadership, code base and license agenda doesn't cut it for those who have the talent, motivation and capital to create a tool chain that does cut it. You don't get to impede that, however righteous you think you are.
Freedom. Deal with it.
Lurking at the bottom of the gravity well, getting old