Spring Piqi Releases
Really happy to have these out. Finally!
Here are some details.
1. piqi-ocaml turned into a separate project
One of the highlights of this release is separation of piqi-ocaml from
piqi. This completes the breaking of what used to be a monolithic
"piqi" repository into individual repos and, more importantly,
In practice, it means a lot more independent development and releases
for all of them.
Piqi compiler for OCaml (now named piqic-ocaml) was rewritten on top
of the "piqi compile" interfaces. Together with piqic-erlang, which
was also improved as a result of this exercise, they make a canonical
example of how to write piqi backends.
There are a lot of improvements overall and some minor
incompatibilities in piqic-ocaml interfaces. See the changelog for
2. piqi cleanup
No longer being held by piqi-ocaml, piqi sources layout has undergone
a major cleanup. Extremely pleased with the outcome:
- 3x faster build
- old multi-stage bootstrapping dropped in favor of a new clean system
which is much easier to understand and use
- windows build overhaul -- now builds on modern OCaml for Windows out
of the box
- support for cross-compiled win32 build
- dropped support for OCaml 3.11 and remove dependency on most Camlp4
Overall, the core project has never been cleaner. For those who
considers hacking on it, this becomes very approachable now.
3. "Piqi is a universal schema language"
http://piqi.org now features a simplified and streamlined description
and project overview.
Check out the updated homepage and rationale
4. Enhanced DSL capabilities
Perhaps all Piqi users know that .piqi syntax is based on the Piq
language. In a sense, Piqi is a declarative domain-specific language
that normally represented in Piq notation and defines itself via a
This combination turned out to be extremely powerful and flexible for
building other declarative DSLs. I've been it using quite successfully
for many small DSLs -- from config files and command-line interfaces
to SQL-like query languages.
The languages typically look nice, and, what's really cool, it takes
no time to build one. All you need is to describe your language in a
.piqi spec and Piqi takes care of both Piq-based concrete syntax and
automatically turning it into abstract syntax of your choice (Protocol
Buffers, JSON, XML and, of course, direct language representation).
A set of new features introduced in this release makes it even nicer:
- optionally omitting square brackets around record representation (so
called frameless Piq input/output)
- optional quotes around single-word string literals (internally known
as relaxed parsing)
- aliases for field and option labels that allow use of shorter names
in Piq notation
- precise control over which syntax elements are allowed as positional
elements and which should be always labeled
5. OCaml and Erlang: preserving unknown Protocol Buffers fields
A new --gen-preserve-unknown-fields flag was introduced for
piqic-ocaml and piqic-erlang. When specified, unrecognized Protocol
Buffers record fields are automatically captured during parsing and
get written back during serialization.
This helps to maintain reversibility of the representation making
applications that use older definitions forward-compatible.