Cap'n Proto library for Erlang.
NOTICE: This is work-in-progress. Feedback appreciated.
The compiler produces standalone schema modules to either compiled
The API are still quite verbose, and subject to change.
Most constructs should work. There are a few corner cases I haven't tested yet. Packed messages are also supported.
The RPC support is shaping up, aiming for a level 1 implementation to be ready soon. The calculator sample from capnproto has been successfully ported to erlang.
In addition to the eunit tests, there are now also PropEr tests to cover more corner cases. I find that they complement each other well, as unit tests are easier to write for a specific slightly contrived scenario, while the property tests are well suited for a general approach covering as many different inputs as possible.
At this point, the goal is to get everything working properly. The next step will be to re-factor it into beautiful code/design, and after that, improvements for efficiency and performance.
In order for
ecapnp to work properly,
ecapnp has to be on the
Erlang lib path (i.e.
to be on your
export ERL_LIBS=$(dirname $(pwd))
capnpc -oerl .../my_schema.capnp
This will (given that everything is working as intended) produce a
A few noteworthy options you can set in the environment are:
ECAPNP_TO_ERL- Save erlang source of compiled schema to path (relative to
ECAPNP_NO_BEAM- Do not compile to beam code.
ECAPNP_LOAD_BEAM- Load compiled beam code on the running node. Useful in case you compile files programatically, rather than using the capnp plugin.
(these options should be available as argument when compiling the code generator request.. alas, that is yet to be implemented)
Head over to ecapnp.astekk.se for documentation etc.