[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-83262":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":9,"totalLinesOfCode":9,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":9,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":9,"createdAt":9,"pushedAt":9,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":16,"starSnapshotCount":16,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},83262,"folly","facebook\u002Ffolly","facebook","An open-source C++ library developed and used at Facebook.",null,"https:\u002F\u002Fgithub.com\u002Ffacebook\u002Ffolly","C++",30412,5866,997,313,0,8,9,24,45,false,"main","2026-06-12 02:04:32","Folly: Facebook Open-source Library\n===================================\n\n# What is `folly`?\n\n\u003Cimg src=\"static\u002Flogo.svg\" alt=\"Logo Folly\" width=\"15%\" align=\"right\" \u002F>\n\nFolly (an acronym loosely after Facebook Open Source Library) is a\nlibrary of C++20 components designed with practicality and efficiency\nin mind. **Folly contains a variety of core library components used extensively\nat Facebook**. In particular, it's often a dependency of Facebook's other\nopen source C++ efforts and place where those projects can share code.\n\nIt complements (as opposed to competing against) offerings\nsuch as Boost and of course `std`. In fact, we embark on defining our\nown component only when something we need is either not available, or\ndoes not meet the needed performance profile. We endeavor to remove\nthings from folly if or when `std` or Boost obsoletes them.\n\nPerformance concerns permeate much of Folly, sometimes leading to\ndesigns that are more idiosyncratic than they would otherwise be (see\ne.g. `PackedSyncPtr.h`, `SmallLocks.h`). Good performance at large\nscale is a unifying theme in all of Folly.\n\n## Check it out in the intro video\n[![Explain Like I’m 5: Folly](https:\u002F\u002Fimg.youtube.com\u002Fvi\u002FWr_IfOICYSs\u002F0.jpg)](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=Wr_IfOICYSs)\n\n# Logical Design\n\nFolly is a collection of relatively independent components, some as\nsimple as a few symbols. There is no restriction on internal\ndependencies, meaning that a given folly module may use any other\nfolly components.\n\nAll symbols are defined in the top-level namespace `folly`, except of\ncourse macros. Macro names are ALL_UPPERCASE and should be prefixed\nwith `FOLLY_`. Namespace `folly` defines other internal namespaces\nsuch as `internal` or `detail`. User code should not depend on symbols\nin those namespaces.\n\n# Physical Design\n\nAt the top level Folly uses the classic \"stuttering\" scheme\n`folly\u002Ffolly` used by Boost and others. The first directory serves as\nan installation root of the library (with possible versioning a la\n`folly-1.0\u002F`), and the second is to distinguish the library when\nincluding files, e.g. `#include \u003Cfolly\u002FFBString.h>`.\n\nThe directory structure is flat (mimicking the namespace structure),\ni.e. we don't have an elaborate directory hierarchy (it is possible\nthis will change in future versions). The subdirectory `experimental`\ncontains files that are used inside folly and possibly at Facebook but\nnot considered stable enough for client use. Your code should not use\nfiles in `folly\u002Fexperimental` lest it may break when you update Folly.\n\nThe `folly\u002Ffolly\u002Ftest` subdirectory includes the unittests for all\ncomponents, usually named `ComponentXyzTest.cpp` for each\n`ComponentXyz.*`. The `folly\u002Ffolly\u002Fdocs` directory contains\ndocumentation.\n\n# What's in it?\n\nBecause of folly's fairly flat structure, the best way to see what's in it\nis to look at the headers in [top level `folly\u002F` directory](https:\u002F\u002Fgithub.com\u002Ffacebook\u002Ffolly\u002Ftree\u002Fmain\u002Ffolly). You can also\ncheck the [`docs` folder](folly\u002Fdocs) for documentation, starting with the\n[overview](folly\u002Fdocs\u002FOverview.md).\n\nFolly is published on GitHub at https:\u002F\u002Fgithub.com\u002Ffacebook\u002Ffolly.\n\n# Build Notes\n\nBecause folly does not provide any ABI compatibility guarantees from commit to\ncommit, we generally recommend building folly as a static library.\n\nfolly supports gcc (5.1+), clang, or MSVC. It should run on Linux (x86-32,\nx86-64, and ARM), iOS, macOS, and Windows (x86-64). The CMake build is only\ntested on some of these platforms; at a minimum, we aim to support macOS and\nLinux (on the latest Ubuntu LTS release or newer.)\n\n## `getdeps.py`\n\nThis script is used by many of Meta's OSS tools.  It will download and build all of the necessary dependencies first, and will then invoke cmake etc to build folly.  This will help ensure that you build with relevant versions of all of the dependent libraries, taking into account what versions are installed locally on your system.\n\nIt's written in python so you'll need python3.6 or later on your PATH.  It works on Linux, macOS and Windows.\n\nThe settings for folly's cmake build are held in its getdeps manifest `build\u002Ffbcode_builder\u002Fmanifests\u002Ffolly`, which you can edit locally if desired.\n\n### Dependencies\n\nIf on Linux or MacOS (with homebrew installed) you can install system dependencies to save building them:\n\n    # Clone the repo\n    git clone https:\u002F\u002Fgithub.com\u002Ffacebook\u002Ffolly\n    # Install dependencies\n    cd folly\n    sudo .\u002Fbuild\u002Ffbcode_builder\u002Fgetdeps.py install-system-deps --recursive\n\nIf you'd like to see the packages before installing them:\n\n    .\u002Fbuild\u002Ffbcode_builder\u002Fgetdeps.py install-system-deps --dry-run --recursive\n\nOn other platforms or if on Linux and without system dependencies `getdeps.py` will mostly download and build them for you during the build step.\n\nSome of the dependencies `getdeps.py` uses and installs are:\n\n  * a version of boost compiled with C++14 support.\n  * googletest is required to build and run folly's tests.\n\n### Build\n\nThis script will download and build all of the necessary dependencies first,\nand will then invoke cmake etc to build folly.  This will help ensure that you build with relevant versions of all of the dependent libraries, taking into account what versions are installed locally on your system.\n\n`getdeps.py` currently requires python 3.6+ to be on your path.\n\n`getdeps.py` will invoke cmake etc.\n\n    # Clone the repo\n    git clone https:\u002F\u002Fgithub.com\u002Ffacebook\u002Ffolly\n    cd folly\n    # Build, using system dependencies if available\n    python3 .\u002Fbuild\u002Ffbcode_builder\u002Fgetdeps.py --allow-system-packages build\n\nIt puts output in its scratch area:\n\n  * `installed\u002Ffolly\u002Flib\u002Flibfolly.a`: Library\n\nYou can also specify a `--scratch-path` argument to control\nthe location of the scratch directory used for the build. You can find the default scratch install location from logs or with `python3 .\u002Fbuild\u002Ffbcode_builder\u002Fgetdeps.py show-inst-dir`.\n\nThere are also\n`--install-dir` and `--install-prefix` arguments to provide some more\nfine-grained control of the installation directories. However, given that\nfolly provides no compatibility guarantees between commits we generally\nrecommend building and installing the libraries to a temporary location, and\nthen pointing your project's build at this temporary location, rather than\ninstalling folly in the traditional system installation directories. e.g., if you are building with CMake you can use the `CMAKE_PREFIX_PATH` variable to allow CMake to find folly in this temporary installation directory when\nbuilding your project.\n\nIf you want to invoke `cmake` again to iterate, there is a helpful `run_cmake.py` script output in the scratch build directory.  You can find the scratch build directory from logs or with `python3 .\u002Fbuild\u002Ffbcode_builder\u002Fgetdeps.py show-build-dir`.\n\n### Run tests\n\nBy default `getdeps.py` will build the tests for folly. To run them:\n\n    cd folly\n    python3 .\u002Fbuild\u002Ffbcode_builder\u002Fgetdeps.py --allow-system-packages test\n\n### `build.sh`\u002F`build.bat` wrapper\n\n`build.sh` can be used on Linux and MacOS, on Windows use\nthe `build.bat` script instead. Its a wrapper around `getdeps.py`.\n\n## Build with cmake directly\n\nIf you don't want to let getdeps invoke cmake for you then by default, building the tests is disabled as part of the CMake `all` target.\nTo build the tests, specify `-DBUILD_TESTS=ON` to CMake at configure time.\n\nNB if you want to invoke `cmake` again to iterate on a `getdeps.py` build, there is a helpful `run_cmake.py` script output in the scratch-path build directory. You can find the scratch build directory from logs or with `python3 .\u002Fbuild\u002Ffbcode_builder\u002Fgetdeps.py show-build-dir`.\n\nRunning tests with ctests also works if you cd to the build dir, e.g.\n`(cd $(python3 .\u002Fbuild\u002Ffbcode_builder\u002Fgetdeps.py show-build-dir) && ctest)`\n\n### Finding dependencies in non-default locations\n\nIf you have boost, gtest, or other dependencies installed in a non-default\nlocation, you can use the `CMAKE_INCLUDE_PATH` and `CMAKE_LIBRARY_PATH`\nvariables to make CMAKE look also look for header files and libraries in\nnon-standard locations.  For example, to also search the directories\n`\u002Falt\u002Finclude\u002Fpath1` and `\u002Falt\u002Finclude\u002Fpath2` for header files and the\ndirectories `\u002Falt\u002Flib\u002Fpath1` and `\u002Falt\u002Flib\u002Fpath2` for libraries, you can invoke\n`cmake` as follows:\n\n```\ncmake \\\n  -DCMAKE_INCLUDE_PATH=\u002Falt\u002Finclude\u002Fpath1:\u002Falt\u002Finclude\u002Fpath2 \\\n  -DCMAKE_LIBRARY_PATH=\u002Falt\u002Flib\u002Fpath1:\u002Falt\u002Flib\u002Fpath2 ...\n```\n\n## Ubuntu LTS, CentOS Stream, Fedora\n\nUse the `getdeps.py` approach above. We test in CI on Ubuntu LTS, and occasionally on other distros.\n\nIf you find the set of system packages is not quite right for your chosen distro, you can specify distro version specific overrides in the dependency manifests (e.g. https:\u002F\u002Fgithub.com\u002Ffacebook\u002Ffolly\u002Fblob\u002Fmain\u002Fbuild\u002Ffbcode_builder\u002Fmanifests\u002Fboost ). You could probably make it work on most recent Ubuntu\u002FDebian or Fedora\u002FRedhat derived distributions.\n\nAt time of writing (Dec 2021) there is a build break on GCC 11.x based systems in lang_badge_test.  If you don't need badge functionality you can work around by commenting it out from CMakeLists.txt (unfortunately fbthrift does need it)\n\n## Windows (Vcpkg)\n\nNote that many tests are disabled for folly Windows builds, you can see them in the log from the cmake configure step, or by looking for WINDOWS_DISABLED in `CMakeLists.txt`\n\nThat said, `getdeps.py` builds work on Windows and are tested in CI.\n\nIf you prefer, you can try Vcpkg. folly is available in [Vcpkg](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002Fvcpkg#vcpkg) and releases may be built via `vcpkg install folly:x64-windows`.\n\nYou may also use `vcpkg install folly:x64-windows --head` to build against `main`.\n\n## macOS\n\n`getdeps.py` builds work on macOS and are tested in CI, however if you prefer, you can try one of the macOS package managers\n\n### Homebrew\n\nfolly is available as a Formula and releases may be built via `brew install folly`.\n\nYou may also use `folly\u002Fbuild\u002Fbootstrap-osx-homebrew.sh` to build against `main`:\n\n```\n  .\u002Ffolly\u002Fbuild\u002Fbootstrap-osx-homebrew.sh\n```\n\nThis will create a build directory `_build` in the top-level.\n\n### MacPorts\n\nInstall the required packages from MacPorts:\n\n```\n  sudo port install \\\n    boost \\\n    cmake \\\n    gflags \\\n    git \\\n    google-glog \\\n    libevent \\\n    libtool \\\n    lz4 \\\n    lzma \\\n    openssl \\\n    snappy \\\n    xz \\\n    zlib\n```\n\nDownload and install double-conversion:\n\n```\n  git clone https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fdouble-conversion.git\n  cd double-conversion\n  cmake -DBUILD_SHARED_LIBS=ON .\n  make\n  sudo make install\n```\n\nDownload and install folly with the parameters listed below:\n\n```\n  git clone https:\u002F\u002Fgithub.com\u002Ffacebook\u002Ffolly.git\n  cd folly\n  mkdir _build\n  cd _build\n  cmake ..\n  make\n  sudo make install\n```\n","Folly是Facebook开发并使用的开源C++库，旨在提供高效且实用的组件。它包含了一系列在Facebook内部广泛使用的库组件，并且经常作为其他Facebook开源C++项目的依赖项。Folly注重性能优化，在设计上有时会采用独特的方法来满足大规模应用的需求，比如`PackedSyncPtr.h`和`SmallLocks.h`等。该库与标准库（std）及Boost库互补而非竞争，仅在现有解决方案无法满足需求时才引入新的实现。Folly适用于需要高性能、可扩展性的C++项目中，特别是在处理大规模数据和服务时能够发挥其优势。",2,"2026-06-11 04:10:44","trending"]