News for hackers. Stuff that matters.
Re:Chrome now uses clang for production builds on Linux by IshKebab on Monday November 17, 2014 @01:12PM (#8619494)
The licence of the compiler doesn't affect what you build with it. I expect the reasons are the same most people are switching to clang:

* 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.

Re:Chrome now uses clang for production builds on Linux by film42 on Monday November 17, 2014 @02:14PM (#8619865)
I recently heard a google employee come speak at my university about how google's main codebase is compiled using clang, and their janitorial work is done using clang mapreduce [1]. Furthermore, that google employee talked about how google is working with the LLVM team to integrate the toolchain into visual studio for cross-platform compilation [2]. Pretty cool stuff!

[1] (similar talk) https://www.youtube.com/watch?v=mVbDzTM21BQ

[2] http://llvm.org/docs/GettingStartedVS.html

Re:Chrome now uses clang for production builds on Linux by 12423gsd on Monday November 17, 2014 @03:15PM (#8620239)
" google is working with the LLVM team to integrate the toolchain into visual studio "

the 3 giants are working together...

Re:Chrome now uses clang for production builds on Linux by pix64 on Monday November 17, 2014 @03:51PM (#8620463)
Re:Chrome now uses clang for production builds on Linux by deng on Monday November 17, 2014 @02:08PM (#8619841)
GCC has support for plugins since version 4.5, which is over four years old. Also, the error messages have improved greatly in the last releases.
Re:Chrome now uses clang for production builds on Linux by DannyBee on Monday November 17, 2014 @03:56PM (#8620500)
You really want to have the infrastructure argument about which is a better compiler infrastructure?

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.

Re:Chrome now uses clang for production builds on Linux by deng on Monday November 17, 2014 @04:22PM (#8620682)
Did I say that gcc has the better infrastructure, the more modern code base, better modularity? I don't think so. That would actually be pretty weird, given that its code base is nearing 30 years of history. But I hope that it is still allowed to say that GCC has made progress the past few years. And I think it is worth refuting claims like "you cannot access the AST in gcc", since this is simply not true anymore. Yes, actually dealing with the AST is baroque, but you can access it nonetheless. There are nice plugins for GCC, like Melt or the python-plugin which make this easier, though. Also, there's the license/freedom thingy, which might not interest you, but others do care about such things.
Re:Chrome now uses clang for production builds on Linux by DannyBee on Monday November 17, 2014 @04:58PM (#8620923)
"Did I say that gcc has the better infrastructure, the more modern code base, better modularity? I don't think so. "

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.

Re:Chrome now uses clang for production builds on Linux by deng on Tuesday November 18, 2014 @03:52AM (#8623015)
> Your reply certainly implied you thought GCC was fine along the same axises your parent said clang was better.

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.

Re:Chrome now uses clang for production builds on Linux by _dps on Tuesday November 18, 2014 @02:46PM (#8625883)
> Besides being a compiler guy, i'm an open source lawyer.

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.

Re:Chrome now uses clang for production builds on Linux by bronson on Monday November 17, 2014 @02:14PM (#8619869)
If you spend a long time damaging your project's internal organization, expect to spend a long time digging back out.
Re:Chrome now uses clang for production builds on Linux by pjmlp on Monday November 17, 2014 @01:48PM (#8619724)
Clang brought new life into C and C++ eco-systems, specially in the sense that since we cannot get rid of C for the time being, at least we can improve the tooling around it to make it safer.

But sometimes I wonder if the license doesn't play a role as well.

Re:Chrome now uses clang for production builds on Linux by _RPM on Monday November 17, 2014 @03:09PM (#8620198)
Why would you want to get rid of C?
Re:Chrome now uses clang for production builds on Linux by wolf550e on Monday November 17, 2014 @03:21PM (#8620282)
To make certain classes of bugs impossible. What will end up hapenning with all code that must be kept is that ever stricter compilers and static analyzers will find the unsafe code and it will be fixed piece by piece.
Re:Chrome now uses clang for production builds on Linux by DannyBee on Monday November 17, 2014 @03:44PM (#8620428)
The license played no role in this switch :)
Re:Chrome now uses clang for production builds on Linux by emn13 on Monday November 17, 2014 @04:22PM (#8620679)
I have no idea whether it's true, but on the topic of gcc's inferiority in the matter of error messages, this source claims it's no longer true: https://gcc.gnu.org/wiki/ClangDiagnosticsComparison

Of course, given the source, apply salt :-).

Re:Chrome now uses clang for production builds on Linux by Alphasite_ on Monday November 17, 2014 @07:36PM (#8621780)
I dont know about C++, but for C Clang certainly feels like it has better error messages than the variant of GCC that the distro the Uni defaults to has, If nothing else, because of the colour.
Re:Chrome now uses clang for production builds on Linux by emn13 on Monday November 24, 2014 @08:13AM (#8652190)
Are the versions you're using up to date, however?
Re:Chrome now uses clang for production builds on Linux by joelthelion on Monday November 17, 2014 @02:31PM (#8619961)
None of these reasons matter at all for production builds. The production build needs to happen only once per release, and the only things that count are performance and reliability.

The last time I checked gcc still had better performance than CLang, but things might have changed since then.

Re:Chrome now uses clang for production builds on Linux by micampe on Monday November 17, 2014 @02:57PM (#8620122)
You don't want to build your nightlies with one compiler and then switch to a different one just for the final release.
Re:Chrome now uses clang for production builds on Linux by DannyBee on Monday November 17, 2014 @03:50PM (#8620452)
1. It depends on your benchmarks. There are some it's behind on, some it's ahead on.

2. LLVM is a lot easier to improve.