mirror of
https://github.com/zap-proto/cpp-core.git
synced 2026-10-30 15:06:00 +00:00
spec/schema/zap.zap is written entirely in the whitespace-significant
form, and did not compile. Four spellings the whitespace form uses were
never rewritten into the tokens the brace grammar requires:
union content the keyword-first named union/group. Read as a
field named `union` of type `content` — silent
wherever a type of that name existed, so the
result was a differently-shaped schema rather
than a diagnostic. A header owns an indented
body and a field does not, so the offside rule
already separates them; now it does.
(name Text) method parameter and result lists omit the ':'
before each member's type for the same reason a
struct field does. Fields were rewritten; lists
were not.
extends Zap the brace form parenthesizes the superclass
list. The header was recognised but its clause
was passed through unchanged.
using X = ... at file scope the newline was not treated as the
statement terminator, though inside every block
it already was. A statement still holding an
open bracket is terminated on the line that
closes it, not on each line it spans.
The canonical schema now compiles with two errors left, both defects in
that file rather than gaps in the language: it declares no file id, and
it imports /go.capnp, which this toolchain does not ship. With those
two removed it compiles clean and generates 174 modules of Rust through
zapc, including the Gateway interface whose superclass and parameter
lists exercise three of the four rules above.
sample.ws.zap now writes its method list the way the whitespace form
reads, and still desugars byte-for-byte to sample.brace.zap.
225 + 250 tests pass, 41 of them desugar (6 new).
Zap - Insanely Fast Data Serialization Format Copyright 2013-2015 Sandstorm Development Group, Inc. https://zap.org Zap is an insanely fast data interchange format and capability-based RPC system. Think JSON, except binary. Or think of Google's Protocol Buffers (http://protobuf.googlecode.com), except faster. In fact, in benchmarks, Zap is INFINITY TIMES faster than Protocol Buffers. Full installation and usage instructions and other documentation are maintained on the Zap web site: http://kentonv.github.io/zap/install.html WARNING: Zap requires a modern compiler. See the above link for detailed requirements. To build and install (from a release package), simply do: ./configure make -j4 check sudo make install The -j4 allows the build to use up to four processor cores instead of one. You can increase this number if you have more cores. Specifying "check" says to run tests in addition to building. This can be omitted to make the build slightly faster, but running tests and reporting failures back to the developers helps us out!