It is my pleasure to announce the Piqi project.

Piqi is a data serialization system compatible with Google Protocol Buffers.
It includes:

- Piqi -- a high-level data definition language. It offers a rich set of
  built-in and user-defined types, powerful type extension and module
  inclusion mechanisms and other features.

- Piq -- a human-friendly data representation language which is designed as
  a better alternative to XML, JSON, CSV, S-expressions, etc.

- Tools for validating, pretty-printing and converting data between Piq,
  JSON and Protocol Buffers binary format.

- A data serialization system for OCaml and Erlang programming languages.
  Using Piqi, programs written in OCaml and Erlang can read and write data
  in Protocol Buffers format, and therefore interoperate with other
  languages that have Protobuf support.

Piqi was inspired by Protocol Buffers and specially designed to be largely
compatible with it:
- Piqi type specifications (.piqi) can be automatically converted to
  equivalent Protobuf specifications (.proto) and vice versa.
- Piqi and Protocol Buffers use the same binary encoding as a serialization

Here are some details.

1. Piqi

    Piqi is a data definition language for Piq and its binary and JSON
    encodings. "Piqi" stands for "Piq Interfaces".
    In addition to record and enum definitions supported by Protobuf, Piqi
    supports definition of variants (tagged unions), lists and type aliases.
    Piqi modules can reuse definitions from other modules by using
    Protobuf-like imports or includes, which are similar to C preprocessors
    "#include", but automatically handle duplicates and include only type
    definitions, imports and extensions.

    Piqi extensions allow to extend several types at a time with the same
    set of properties, which turned out to be an extremely useful feature
    and a very good alternative to structured inheritance.

    The combination of rich data model, extensibility and module inclusion
    allows Piqi language to define itself in a series of '.piqi'
    specifications. Such self-definition property is interesting by itself,
    but it is also heavily relied on for implementing Piqi. Basically, Piqi
    self-definition serves as a grammar which is used for parsing '.piqi'
    specification directly into intermediate representation without any
    manually-written code.

2. Piq

    Piq is a text-based language that allows humans to conveniently read,
    write and edit structured data.

    Piq has a concise and powerful syntax:
    - No syntax noise compared to XML.
    - Reasonable amount of parenthesis compared to S-expressions.
    - Comments.

    Piq supports the following data literals:
    - Unicode strings, booleans, integer and floating point numbers
      (including "infinities" and "NaN");
    - binary strings (byte arrays);
    - verbatim text.

    Piq is a stream format: one Piq file (stream) can contain many typed
    data objects. When Piq stream is converted to binary or JSON formats,
    information about data types is included in the stream in a very compact
    and elegant manner.


Project homepage:

GitHub repository:

Compatibility with Protocol Buffers:

Examples of '.piq' files represented in various formats and examples of
correspondence between '.piqi' and '.proto':

Piqi self-definition (also contains "descriptor.proto" converted to Piqi):

Reading and writing "addressbook.proto" in OCaml and Erlang:

Your comments, suggestions and contributions are welcome! Please don't hesitate
to contact me if you have any questions.


You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to