News for hackers. Stuff that matters.
Re:Folly – Faceboook’s open source C++ library by hortense on Thursday April 16, 2020 @08:28AM (#22888666)
"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.
Re:Folly – Faceboook’s open source C++ library by swiftcoder on Thursday April 16, 2020 @09:33AM (#22889165)
I'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.

Re:Folly – Faceboook’s open source C++ library by jesboat on Saturday April 18, 2020 @01:30PM (#22909337)
Don'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.)

Re:Folly – Faceboook’s open source C++ library by yfeldblum on Friday April 17, 2020 @07:07PM (#22903838)
The 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.

Re:Folly – Faceboook’s open source C++ library by m463 on Thursday April 16, 2020 @09:46AM (#22889289)
It 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?

Re:Folly – Faceboook’s open source C++ library by msla on Thursday April 16, 2020 @01:37PM (#22891692)
> 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.

Re:Folly – Faceboook’s open source C++ library by jesboat on Saturday April 18, 2020 @01:33PM (#22909380)
> 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) which supports all of c++14

Re:Folly – Faceboook’s open source C++ library by foobar502 on Thursday April 16, 2020 @10:35AM (#22889779)
Could you elaborate on that? What aspects of using clang as opposed to gcc were so beneficial?
Re:Folly – Faceboook’s open source C++ library by pdpi on Thursday April 16, 2020 @10:59AM (#22890031)
The 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.

Re:Folly – Faceboook’s open source C++ library by andrewflnr on Thursday April 16, 2020 @01:30PM (#22891614)
Is it just me or is that a recipe for Heisenbugs?
Re:Folly – Faceboook’s open source C++ library by btian on Thursday April 16, 2020 @11:32AM (#22890436)
Better error messages
Re:Folly – Faceboook’s open source C++ library by Jyaif on Thursday April 16, 2020 @12:17PM (#22890882)
I'm talking about the sanitizers, clang-tidy, clang-format, and of course the error messages of clang itself.
Re:Folly – Faceboook’s open source C++ library by Cthulhu_ on Thursday April 16, 2020 @08:59AM (#22888885)
I 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.
Re:Folly – Faceboook’s open source C++ library by pdpi on Thursday April 16, 2020 @10:59AM (#22890040)
I posted this elsewhere in this thread — 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.
Re:Folly – Faceboook’s open source C++ library by utopcell on Thursday April 16, 2020 @11:00AM (#22890053)
Google is primarily using clang, not gcc anymore.