capnp-fortran
Native modern-Fortran Cap’n Proto: wire runtime, packed and canonical codecs, capnpc-fortran schema plugin, optional C ABI, and two-party RPC. No C library underneath.
New here?¶
Goal |
Go to |
|---|---|
Install fpm / pixi and build the suite |
|
Write and read a message from a |
|
Generate modules with |
|
Call a capability over a socket |
|
Byte-compatible with c-capnproto / C++ |
|
Full procedure list |
Install (shortest path)¶
With fpm and a recent gfortran:
$ git clone https://github.com/HaoZeke/capnp-fortran.git
$ cd capnp-fortran
$ fpm build && fpm test
Pinned toolchain (gfortran, fpm, fypp, capnp):
$ pixi install
$ pixi run build && pixi run test
The plugin binary lands under build/gfortran_*/app/capnpc-fortran.
Details, codegen, and interop builds: Install.
What you get¶
Wire runtime: struct / list / far / double-far / capability pointers, growable arena, default-XOR scalars, Text/Data, traversal and depth guards
Serialization: stream framing, packed (whole-buffer + incremental), file helpers, zero-copy views, orphans, deep copy
Canonical form: byte-parity with
capnp convert binary:canonicalCodegen:
capnpc-fortranas acapnp compile -oplugin — structs, unions, groups, enums, constants, imports, branded generics, typed interface stubsC ABI:
capnp_cabi+ cmocka golden master vs c-capnprotoRPC: two-party level 1 vat (bootstrap, calls, pipelining, embargo), level 2 persistence hooks, optional live C++ peer test
Parity table and honesty about L3/L4 (unimplemented, same as C++): see the project README.
Documentation map¶
fpm, pixi, building the plugin, and optional interop deps.
First message round-trip, then a typed Adder RPC client and server.
capnp compile -o capnpc-fortran and the shape of generated modules.
Module layers, wire mapping, arena, emitter, and the RPC vat.
c-capnproto golden master and the capnp-C++ EzRpc peer.
Two-party level 1: tables, pipeline, streams, persistence hooks.
Public procedures for messages, fields, pack, canonical, C ABI, RPC.