Git Product home page Git Product logo

google / flatbuffers Goto Github PK

View Code? Open in Web Editor NEW
22.1K 642.0 3.2K 17.96 MB

FlatBuffers: Memory Efficient Serialization Library

Home Page: https://flatbuffers.dev/

License: Apache License 2.0

CMake 0.65% Shell 0.28% Makefile 0.01% C++ 39.62% Go 1.49% Java 6.26% C# 5.99% Python 6.99% Batchfile 0.02% JavaScript 5.67% PHP 1.90% TypeScript 3.66% C 0.01% Dart 4.15% Lua 0.98% Rust 10.68% Kotlin 4.52% Roff 0.01% Swift 6.60% Starlark 0.52%
flatbuffers serialization serialization-library json-parser marshalling rpc zero-copy mmap cross-platform c-plus-plus

flatbuffers's Introduction

logo FlatBuffers

Build status BuildKite status Fuzzing Status OpenSSF Scorecard Join the chat at https://gitter.im/google/flatbuffers Discord Chat Twitter Follow Twitter Follow

FlatBuffers is a cross platform serialization library architected for maximum memory efficiency. It allows you to directly access serialized data without parsing/unpacking it first, while still having great forwards/backwards compatibility.

Quick Start

  1. Build the compiler for flatbuffers (flatc)

    Use cmake to create the build files for your platform and then perform the compliation (Linux example).

    cmake -G "Unix Makefiles"
    make -j
    
  2. Define your flatbuffer schema (.fbs)

    Write the schema to define the data you want to serialize. See monster.fbs for an example.

  3. Generate code for your language(s)

    Use the flatc compiler to take your schema and generate language-specific code:

    ./flatc --cpp --rust monster.fbs
    

    Which generates monster_generated.h and monster_generated.rs files.

  4. Serialize data

    Use the generated code, as well as the FlatBufferBuilder to construct your serialized buffer. (C++ example)

  5. Transmit/store/save Buffer

    Use your serialized buffer however you want. Send it to someone, save it for later, etc...

  6. Read the data

    Use the generated accessors to read the data from the serialized buffer.

    It doesn't need to be the same language/schema version, FlatBuffers ensures the data is readable across languages and schema versions. See the Rust example reading the data written by C++.

Documentation

Go to our landing page to browse our documentation.

Supported operating systems

  • Windows
  • macOS
  • Linux
  • Android
  • And any others with a recent C++ compiler (C++ 11 and newer)

Supported programming languages

Code generation and runtime libraries for many popular languages.

  1. C
  2. C++ - snapcraft.io
  3. C# - nuget.org
  4. Dart - pub.dev
  5. Go - go.dev
  6. Java - Maven
  7. JavaScript - NPM
  8. Kotlin
  9. Lobster
  10. Lua
  11. PHP
  12. Python - PyPI
  13. Rust - crates.io
  14. Swift - swiftpackageindex
  15. TypeScript - NPM
  16. Nim

Versioning

FlatBuffers does not follow traditional SemVer versioning (see rationale) but rather uses a format of the date of the release.

Contribution

To contribute to this project, see CONTRIBUTING.

Community

Security

Please see our Security Policy for reporting vulnerabilities.

Licensing

Flatbuffers is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.


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.