5 ms·
"folly requires gcc" That's surprising to me. Clang and the associated tools are so useful I would have expected all tech companies to have migrated to it.
by hortense 6y ago
"folly requires gcc"
That's surprising to me.
Clang and the associated tools are so useful I would have expected all tech companies to have migrated to it.
- Cthulhu_ 6y agoI could be wrong, but, a quick Googling / wiki shows clang is from 2007, whilst facebook was founded 2004, and even though clang was available in 2007, it takes years before people consider using newer tools like clang over proven technology, especially in the C space.
- swiftcoder 6y agoI'm pretty sure that "folly requires gcc 5.1+" is meant to be a statement about the minimum GCC version, and not that GCC is the only compiler that will work. If you poke around the github issues, you'll note that several folks are successfully compiling folly with Clang.
- m463 6y agoIt seems like a pretty mature cross-platform library. It could be their statement "folly requires gcc 5.1+" meant gcc 5.1 or greater, where clang might be greater?
- msla 6y ago> It could be their statement "folly requires gcc 5.1+" meant gcc 5.1 or greater, where clang might be greater? Reminds me of an old joke: "The package said it required Windows 95 or better, so I installed Linux." They'd save a lot of guessing by putting in which Special Modern Features their code relies on.
- jesboat 6y ago> They'd save a lot of guessing by putting in which Special Modern Features their code relies on. The first paragraph of the readme starts with "Folly (acronymed loosely after Facebook Open Source Library) is a library of C++14 components" and gcc 5.1 is the first version (https://gcc.gnu.org/projects/cxx-status.html#cxx14 https://gcc.gnu.org/projects/cxx-status.html#cxx14) which supports all of c++14
- foobar502 6y agoCould you elaborate on that? What aspects of using clang as opposed to gcc were so beneficial?
- pdpi 6y agoThe sanitisers are a good reason (UBSan, ASan). Clang compilation is faster than GCC, also. Don't know if it's still true, but when I was at Facebook we used Clang for debug builds, and GCC for production builds.
- andrewflnr 6y agoIs it just me or is that a recipe for Heisenbugs?
- btian 6y agoBetter error messages
- Jyaif 6y agoI'm talking about the sanitizers, clang-tidy, clang-format, and of course the error messages of clang itself.
- yfeldblum 6y agoThe highlighted sentence gives the minimum version of gcc which folly broadly supports. One motivation for this is so that a user may know whether folly supports the version of the gcc c++ compiler which is preinstalled on their system, since many systems ship with a preinstalled gcc. Likewise for systems which ship with a blessed package repo. But folly also supports recent versions of clang and msvc, as other commenters here note.
- jesboat 6y agoDon't know why people downvoted you. The intended interpretation was "if gcc, must be 5.1+", but I can see how it might be misunderstood as it was written. The readme was updated and now reads > folly supports gcc (5.1+), clang, or MSVC. It should run on Linux (x86-32, x86-64, and ARM), iOS, macOS, and Windows (x86-64). The CMake build is only tested on some of these platforms; at a minimum, we aim to support macOS and Linux (on the latest Ubuntu LTS release or newer.) folly is used in FB opensource projects on Windows, macOS, and Linux (e.g. watchman) and Android and iOS (React Native, though that might not include the whole library.)