/Deco

Delimiter Collision Free Format

Primary LanguageC++OtherNOASSERTION

Deco - Delimiter Collision Free Format

Deco is a human readable text format which avoids the delimiter collision problem.

Deco has minimal and simple syntax, while still being able to represent grouping and nesting. It's very easy to read and write by humans.

For example this is how the JSON example from Wikipedia would look like in Deco:

Deco JSON
firstName: John
lastName: Smith
isAlive: true
age: 27
address:
    streetAddress: 21 2nd Street
    city: New York
    state: NY
    postalCode: 10021-3100
:
phoneNumbers:
    type: home
    number: 212 555-1234
    type: office
    number: 646 555-4567
    type: mobile
    number: 123 456-7890
:
children:
:
spouse: null
{
  "firstName": "John",
  "lastName": "Smith",
  "isAlive": true,
  "age": 27,
  "address": {
    "streetAddress": "21 2nd Street",
    "city": "New York",
    "state": "NY",
    "postalCode": "10021-3100"
  },
  "phoneNumbers": [
    {
      "type": "home",
      "number": "212 555-1234"
    },
    {
      "type": "office",
      "number": "646 555-4567"
    },
    {
      "type": "mobile",
      "number": "123 456-7890"
    }
  ],
  "children": [],
  "spouse": null
}

Since Deco is simple and doesn't have to deal with delimiter collisions it's also efficient. In a benchmark against JSON Deco had:

  • over 40% smaller file size
  • over 700% faster output serialization
  • over 2000% faster input parsing

To learn how to use the Deco format, see the tutorial.

To learn how the Deco format works, see the specification.

Deco Library

The Deco library is header-only and uses C++17.

Building

The library uses CMake with Conan package manager to manage dependencies. For Conan to be able to automatically find the dependency packages use the following command:

conan remote add enhex https://api.bintray.com/conan/enhex/enhex

Using Conan you can consume the library as the package Deco/master@enhex/stable from the enhex remote.

If you're not using Conan to generate your project you can use conan with generators like visual_studio to generate a .props file that you can add to your VS project, or use the txt generator to get a list of the include directories you need to use.

Using

To learn how to use the Deco library see the documentation, and the tests for examples.

License

Deco is licensed under a modified version of Apache 2.0 license, that removes some of the conditions, including the requirement to give a copy of the license in Object form distribution.