FreeBSD Throws the Clang/LLVM Switch: Future Releases Use LLVM
An anonymous reader writes "Brooks Davis has announced that the FreeBSD Project has now officially switched to Clang/LLVM as C/C++ compiler. This follows several years of preparation, feeding back improvements to the Clang and LLVM source code bases, and nightly builds of FreeBSD using LLVM over two years. Future snapshots and all major FreeBSD releases will ship compiled with LLVM by default!"
The reason FreeBSD switches to clang/LLVM is the license: BSD instead of GPLv3.
You should give clang a try. The LLVM has a much cleaner api then gcc and the error message's are also more readeable. In terms of speed, the difference is shrinking with each release.
I know of LLVM, but haven't used it, and it really seems like very few hardcore Linux/OSS devs have a clue about it. Is there really a clear advantage, or is it just an excuse to write a new compiler to solve a problem that doesn't exist?
Much better modularization, so that the tokenizer used by the compiler is easily available to other tools, so that your editor does not have to (try to) re-implement all the intricacies of C++ syntax, so that parse tree & symbolic info is available to your IDE, so that it does not have to try to re-implement parsing of all the intricacies of C++ templates & namespaces in order to give you cross-referencing or even re-factoring functions (not to mention support for a debugger that can actually figure out types in a complex inheritance hierarchy).
This explains it well: http://unix.stackexchange.com/a/49970/7345
Generally a lot of BSD users don't like the GPL, and getting rid of a GPLed compiler makes them quite happy.
Also, although I've heard a lot about the inner workings of GCC being rather intertwined and convoluted, whereas LLVM is simpler to work with and modify (not sure how true this is).
Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
Could check this article: http://clang.llvm.org/comparison.html
Apple made the switch a while back in Xcode. The end result was much better debugging and refactoring capabilities.
If you can't convince them, convict them.
It isn't necessarily an issue with the GPL (aside from 3 being invasive, which I personally have an issue with and so do the lawyers I work with) - I have a problem with Stallman's (aka RMS) model, which says charge for hardware and give the software with source away for free.
I worked for a CAD software company (we were bought by a huge multinational conglomerate, so I technically still work for them, but I moved around and rarely touch CAD these days). In our former incarnation, we sold exactly no hardware and were bundled with exactly zero hardware, but ran on pretty much every platform imaginable (9 at one point, but much fewer now, since our customers are mostly moving to Linux or Windows). Giving away our software (not to mention the source code) would be a really bad business model, but to appease those in RMS's dream world, we'd need to find hardware partners and give it away for free with the hardware and be paid by the hardware vendor - but since we have to give away source, we'd more than likely use an in-house developed proprietary language to make porting as difficult as possible. This, in fact, is a BAD and not very open business model - if we'd been bought by our current owner, we'd almost certainly be proprietary software for their hardware and not run on platforms like Linux or even Windows. This happens in the console world all the time - when Microsoft bought Bungie, they basically shafted what Bungie was known for - mac games (and took a year to release Halo on Windows/Mac to keep it XBox exclusive as long as possible to the ire of Steve Jobs - later releases became XBox exclusive). If you think that is a good thing, great for you - I don't. Incidentally, the part of the company I work for has an open data model as well - that makes it easy for customers to switch, but we are doing our jobs well because few actually do.
I've been at odds with RMS over this for years...
is there a reason for not making the front ends dynamic libraries which could be linked by any program that wants to parse source code?
Quoth the Stallman himself:
One of our main goals for GCC is to prevent any parts of it from being used together with non-free software. Thus, we have deliberately avoided many things that might possibly have the effect of facilitating such usage, even if that consequence wasn't a certainty. We're looking for new methods now to try to prevent this, and the outcome of this search would be very important in our decision of what to do.
Not only is the poor design true, it was very intentional. This is why we need the LLVM project. KDevelop and such shouldn't have to write their own compiler front ends to get feature parity with Visual Studio; but right now they do.
-1 overrated isn't the same thing as "I disagree".
I don't see anybody addressing this question adequately. Here goes for a start.
1) g++ has simply awful error messages for template code. clang++ has MUCH more helpful error messages. Of not quite so much importance, all clang/clang++ error messages are significantly better than those of gcc/g++. Looks like clang++ has spurred g++ to improve error messages in 4.8 though. They NEEDED to be improved.
2) clang++ 3.1 has significantly better C++11 support than g++ 4.7:
Rvalue refs for *this
Alignment support
Strong compare-exchange
Bidirectional fences
Atomics in signal handlers
Also borrows from C99 one very significant enhancement: C99 designated initializers
References:
clang: Expressive Diagnostics
C++0x/C++11 Support in GCC
C++98 and C++11 Support in Clang