[erlang-questions] Announce: the Piqi project
Mon Sep 13 13:14:02 CEST 2010
It looks very interesting - in fact so much that I will ask a few questions
(always a good sign, right?).
On the higher level: Are there any plans for providing a way to specify your
own binary encoding?
On the lower level: If I have a PDU where one field is present if another
field has a specific value how would that look in Piqi? And what if the
dependent field is separated from its condition field by many other fields?
Example: (M means mandatory, C means conditional)
Field15 C - present if Field2 is 4.
I am dealing with a protocol that has this kind of behaviour and I am
looking into writing my own binary grammar, but I would much rather piggy
bag on something else if many reasons on top of laziness ;-)
On Mon, Sep 13, 2010 at 10:07, Anton Lavrik <> wrote:
> It is my pleasure to announce the Piqi project to the Erlang community.
> just released a new version which features Erlang support.
> Piqi is a cross-language data serialization system compatible with Google
> Protocol Buffers with native support for Erlang and OCaml.
> OCaml and Erlang programmers can use Piqi to conveniently serialize and
> deserialize data using a portable binary format which can be understood by
> programs written in Python, Java, C++ and other languages supported by
> Protocol Buffers. In this sense, Piqi provides Protocol Buffers support for
> OCaml and Erlang.
> Compared to Protocol Buffers, Piqi relies on a richer data definition
> which has a more natural mapping to functional languages. For instance, in
> addition to records and enums, Piqi supports variants (tagged unions),
> subtyping, lists and type aliases.
> Some other Piqi features include:
> - Support for data schema evolution (Protocol Buffers style).
> - "import" and "include" for reusing type definitions from other modules.
> - Powerful extensions mechanism for records and variants.
> - Structured default values for optional fields.
> Compatibility between Piqi and Protocol Buffers is maintained as follows:
> - Piqi specifications can be automatically converted to equivalent Protobuf
> specifications and vice versa (with very few exceptions).
> - Piqi and Protocol Buffers use the same binary encoding as a serialization
> Piqi comes with several additional tools:
> - Piq -- a high-level data representation language. It has full support for
> data types and it is easier to read, write and edit compared to XML or
> - Piqi tools for validating, pretty-printing and converting data between
> JSON and portable binary encoding.
> Erlang support highlights
> - Generated Erlang type and record definitions as well as
> serialization/deserialization code are EEP8-compliant and provide all
> type information for Dialyzer.
> - Support for recursive record types.
> - Support for Unicode strings which can be passed as string() (i.e. list of
> Unicode codepoints) or utf-8 binary().
> - Support for custom Erlang identifiers. For example, if some identifier
> existing Proto or Piqi specification conflicts with an Erlang keyword, it
> possible to define a custom Erlang-specific identifier without changing
> original one and breaking backward compatibility.
> - Capitalized and "CamelCase" Piqi/Protobuf identifiers are automatically
> converted to uncapitalized and "camel_case" Erlang ids.
> - Configurable prefixes for type and record identifiers (since Erlang
> have any kind of namespace support for types and records, we need to
> them to avoid conflicts with names defined in other modules).
> - Tested with Erlang/OTP R13B04 and R14A.
> Further references
> GitHub repository and several Erlang examples:
> Details of Piqi to Erlang mapping:
> Your comments, suggestions and contributions are welcome! Don't hesitate to
> contact me if you have any questions.
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
More information about the erlang-questions