6 ms·
Does anyone have details on why they made the switch ? The email states very little improvements, even a bug on 32-bit Debians. Is this only because of the lice
by rakoo 12y ago
Does anyone have details on why they made the switch ? The email states very little improvements, even a bug on 32-bit Debians. Is this only because of the license of the compiler ?
- CJefferson 12y agoThey do mention: > 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.
- moyix 12y agoOn the other hand, clang is very much a second class citizen on Windows.
- CJefferson 12y agoTrue, but is gcc much better, or does chrome use visual studio? (I honestly don't know, wondered if anyone else did)
- Joky 12y agoYes.
- experimental- 12y agoSo is GCC. Perhaps it's still one less compiler to deal with, if they don't need GCC on any platform any more.
- zanny 12y agoEvery compiler that is not (and some may even consider it second class considering its UX) MSVC is a second class citizen on Windows.
- 0x09 12y agoI don't use the MSVC toolchain or Windows for that matter, so I don't have a good compass for this, but the impression from the newsletter, dev meetings etc is that clang-cl is constantly being improved. Is the situation still that poor?
- cremno 12y agoThey have a site covering compatibility with MSVC: http://clang.llvm.org/docs/MSVCCompatibility.html http://clang.llvm.org/docs/MSVCCompatibility.html 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.
- DannyBee 12y ago???? Compared to GCC? You can now build a fairly well-functioning chrome binary, from visual studio, with clang/llvm, without source code changes.
- IshKebab 12y agoThe 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.
- pjmlp 12y agoClang 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.
- _RPM 12y agoWhy would you want to get rid of C?
- wolf550e 12y agoTo 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.
- DannyBee 12y agoThe license played no role in this switch :)
- deleted 12y ago[deleted]
- deng 12y agoGCC 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.
- nly 12y agoGoogle are invested in Clang by virtue of employing guys like Chandler[0] to work on it. When you're scrubbing up monstrous codebases like Chrome, tooling matters. Clangs architecture, and things like all the sanitizers that are part of the broader project, presumably go a long way. [0] https://twitter.com/chandlerc1024 https://twitter.com/chandlerc1024
- mcescalante 12y agoI posted a link to a 2011 talk from Chromium devs about using clang in another comment here, but below is a summary of what they seemed to enjoy from clang (at least, from the talk points): - 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.
- DannyBee 12y agoBecause you can get a single toolchain that is state of the art, can build for all of chrome's supported platforms (in fact, it could do it from a single binary if you really wanted), and one can easily improve to get the performance you want out of.