Coder Social home page Coder Social logo

smyte-db's Introduction

smyte-db

This repo is the central build environment for all Smyte C++ projects. For documentation, issues, and code for the submodules in this project, please see each project's individual repo:

Smyte's C++ development is based on facebook's folly and wangle libraries to build high performance servers. The build system uses Google's bazel. By default, it builds a single executable binary that can be deployed to production directly.

Setup

  • Install bazel, libssl-dev, and libatomic1.
  • Ensure submodules are up-to-date: git submodule update --init.
  • Build a project: bazel clean && bazel build ratelimit. The first build may take a while to fetch all the third-party dependencies and build static libraries.

Style guide

Follow Google's C++ style guide with a few exceptions:

  • Using C++ exception is allowed because both folly and wangle use it extensively.
  • Each line can have up to 120 characters instead of 80. Google sticks with 80 for historical reasons, but we have much wider screens now.
  • Method names use camel case, which starts with a lower case letter, e.g., foo.addBack(), instead of pascal case, which starts with a capital letter, e.g., foo.AddBack(). The main reason is that both folly and wangle use camel case, and we want to be consistent. Note that rocksdb uses pascal case because it is derived from Google's leveldb code. While we also use rocksdb heavily, we only use it as a library as supposed to involving it in the inheritance hierarchy.
  • Use cpplint to check for style violations. We use the following config:
  --filter=-legal/copyright,-build/c++11,
  --linelength=120,
  • Name files using camel case and local variables using pascal case for the same reason.
  • Use .cpp instead of .cc as extension for C++ souce code files. There is really no difference between the two. Google uses .cc, and its build rule is also called cc_binary for example. But we'd rather be consistent with the main facebook C++ libraries.
  • Use Clang Format to format your source code with the following config:
  BasedOnStyle: Google
  ColumnLimit: 119
  DerivePointerAlignment: false
  PointerAlignment: Left
  AccessModifierOffset: -1

Test

To run all tests, simply execute bazel test //...:all.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.