* Modern modular design (everything is libraries) * Faster compile times * Nicer error messages
The modular design in particular is a good reason that might not be obvious at first. It lets you do things like debuggers, code formatters and static analysers in a much more sane and robust way than GCC's "no plugins, everything must be separate and flaky" way.
[1] (similar talk) https://www.youtube.com/watch?v=mVbDzTM21BQ
the 3 giants are working together...
Even GCC developers (like I was ) don't really question it.
The only thing GCC buys you right now, at all, is slightly better performance (it varies depending on your benchmark) and support for a larger variety of odd embedded systems.
On the other hand, LLVM is very easy to modify, can be built as a library (as can clang), has a sane, well defined IR, etc.
Your reply certainly implied you thought GCC was fine along the same axises your parent said clang was better.
"But I hope that it is still allowed to say that GCC has made progress the past few years." You are talking to a guy who helped make some of this progress (for example, I helped build the tree-ssa project that brought a language independent middle IR and SSA optimizers to GCC). It's certainly made progress, but that progress had been fought about for the 5 years before that. At the same time, GCC lost good developers during these fights due to wanting to get stuff done and not deal with politics.
"Also, there's the license/freedom thingy, which might not interest you, but others do care about such things."
Actually, it interests me immensely. I helped with things like the libstdc++ exception, etc. Besides being a compiler guy, i'm an open source lawyer.
But in the end, I choose stuff based on technical merits first, freedom second. You are of course, welcome to do as you please.
No. I simply corrected a false statement regarding gcc. I did not compare it to clang at all. I have no illusions how gcc does compare to clang w.r.t. to code quality, modularity, etc. As I've said: it would be weird if it were otherwise. It's really not hard to beat gcc in that area.
> You are talking to a guy who helped make some of this progress
Thank you (no irony intended).
> Actually, it interests me immensely.
It may interest you, but as you say yourself:
> But in the end, I choose stuff based on technical merits first, freedom second
>You are of course, welcome to do as you please.
Will do, thanks.
Apologies for replying in-thread (I couldn't find contact in your profile). Would it be possible to ask you a few questions about a perhaps-novel compiler licensing question for an open source application we're developing (we're a commercial entity and can pay for your time)? If so you can reach me at the email in my profile.
But sometimes I wonder if the license doesn't play a role as well.
Of course, given the source, apply salt :-).
The last time I checked gcc still had better performance than CLang, but things might have changed since then.
2. LLVM is a lot easier to improve.
> With the switch to clang, binary size dropped about 8% while performance mostly stayed the same. Startup time improved a bit,
Also I can imagine it might be nice to use the same compiler on different OSes, and gcc is very much a 2nd class citizen on mac.
I think it's pretty acceptable, if you're writing C. As you can see, C++ support is only partially completed (no exceptions!). But you're right, Clang on Windows gets constantly improved.
The creation of good debugging information (MSVC's /Zi or even /ZI option) is also missing. For a first class citizen, support of the (undocumented) PDB format is a requirement in my opinion.
You can now build a fairly well-functioning chrome binary, from visual studio, with clang/llvm, without source code changes.
- Useful warnings, they look good, and are on by default.
- More than a compiler, lets you build your own tools (example: AddressSanitizer)
- Better performance (less time) with clang vs. gcc for both -O0 -g and -O2 (at the time the benchmark was done on 8 cores, 24GB)
In summary / tl;dr : they enjoy diagnostics, the clang code base, how it works, and the ability to write their own tools. It seems like it's more to do with preference/performance and less to do with licensing. I'm sure that now they're doing many more things with clang since three years has passed since the aforementioned talk.